Module: wine Branch: master Commit: d8241b8db67cde8f70e6bea3694686d84023ca6e URL: http://source.winehq.org/git/wine.git/?a=commit;h=d8241b8db67cde8f70e6bea369...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Nov 16 20:26:30 2011 +0100
comctl32: Avoid losing the color masks in CreateMappedBitmap.
---
dlls/comctl32/commctrl.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 76ab3a1..c0d0043 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -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;