Alexandre Julliard : comctl32: Avoid losing the color masks in CreateMappedBitmap.
Alexandre Julliard
julliard at winehq.org
Thu Nov 17 12:52:33 CST 2011
Module: wine
Branch: master
Commit: d8241b8db67cde8f70e6bea3694686d84023ca6e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d8241b8db67cde8f70e6bea3694686d84023ca6e
Author: Alexandre Julliard <julliard at 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;
More information about the wine-cvs
mailing list