comctl32: Avoid losing the color masks in CreateMappedBitmap.

This commit is contained in:
Alexandre Julliard 2011-11-16 20:26:30 +01:00
parent d4aacad9ea
commit d8241b8db6

View file

@ -796,7 +796,10 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
nColorTableSize = (1 << lpBitmap->biBitCount);
else
nColorTableSize = 0;
nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
nSize = lpBitmap->biSize;
if (nSize == sizeof(BITMAPINFOHEADER) && lpBitmap->biCompression == BI_BITFIELDS)
nSize += 3 * sizeof(DWORD);
nSize += nColorTableSize * sizeof(RGBQUAD);
lpBitmapInfo = GlobalAlloc (GMEM_FIXED, nSize);
if (lpBitmapInfo == NULL)
return 0;