Author: tfaber
Date: Sun Jan 29 23:30:22 2012
New Revision: 55306
URL:
http://svn.reactos.org/svn/reactos?rev=55306&view=rev
Log:
[COMCTL32]
- Fix MSVC build. Already sent upstream
Modified:
trunk/reactos/dll/win32/comctl32/imagelist.c
Modified: trunk/reactos/dll/win32/comctl32/imagelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Sun Jan 29 23:30:22 2012
@@ -3094,13 +3094,13 @@
if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR)
{
- char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
- BITMAPINFO *bmi = (BITMAPINFO *)buffer;
+ BITMAPINFO *bmi = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET(
BITMAPINFO, bmiColors[256] ));
+ if (bmi == NULL)
+ return NULL;
TRACE("Creating DIBSection %d x %d, %d Bits per Pixel\n",
sz.cx, sz.cy, himl->uBitsPixel);
- memset( buffer, 0, sizeof(buffer) );
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi->bmiHeader.biWidth = sz.cx;
bmi->bmiHeader.biHeight = sz.cy;
@@ -3116,6 +3116,7 @@
DeleteObject( tmp );
}
hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, 0, 0);
+ HeapFree( GetProcessHeap(), 0, bmi );
}
else /*if (ilc == ILC_COLORDDB)*/
{