[1/3] gdiplus: Fix reading the mask bits in GdipCreateBitmapFromHICON.

Dmitry Timoshkov dmitry at baikal.ru
Mon Jan 14 22:48:08 CST 2013


biHeight has to specify full height of hbmMask, otherwise GetDIBits fails
to read lower half of hbmMask when hbmColor == 0.
---
 dlls/gdiplus/image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 9d88629..558e300 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -1691,7 +1691,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
 
     bih.biSize = sizeof(bih);
     bih.biWidth = width;
-    bih.biHeight = -height;
+    bih.biHeight = iinfo.hbmColor ? -height: -height * 2;
     bih.biPlanes = 1;
     bih.biBitCount = 32;
     bih.biCompression = BI_RGB;
-- 
1.8.0.2




More information about the wine-patches mailing list