Commit d8241b8d authored by Alexandre Julliard's avatar Alexandre Julliard

comctl32: Avoid losing the color masks in CreateMappedBitmap.

parent d4aacad9
...@@ -796,7 +796,10 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, ...@@ -796,7 +796,10 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
nColorTableSize = (1 << lpBitmap->biBitCount); nColorTableSize = (1 << lpBitmap->biBitCount);
else else
nColorTableSize = 0; 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); lpBitmapInfo = GlobalAlloc (GMEM_FIXED, nSize);
if (lpBitmapInfo == NULL) if (lpBitmapInfo == NULL)
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment