Alexandre Julliard : user32: Pass valid dimensions to GetDIBits.
Alexandre Julliard
julliard at winehq.org
Mon Aug 29 11:28:34 CDT 2011
Module: wine
Branch: master
Commit: 43240527b61aa7c1b4663cd53c2d359284e6849d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=43240527b61aa7c1b4663cd53c2d359284e6849d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Aug 29 11:29:25 2011 +0200
user32: Pass valid dimensions to GetDIBits.
---
dlls/user32/cursoricon.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 4c7658d..aeb1987 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -2732,12 +2732,11 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
memcpy(bi, &ds.dsBmih, sizeof(BITMAPINFOHEADER));
}
- /* Get the color table or the color masks */
- GetDIBits(dc, hnd, 0, ds.dsBm.bmHeight, NULL, bi, DIB_RGB_COLORS);
-
bi->bmiHeader.biWidth = desiredx;
bi->bmiHeader.biHeight = desiredy;
- bi->bmiHeader.biSizeImage = 0;
+
+ /* Get the color table or the color masks */
+ GetDIBits(dc, hnd, 0, ds.dsBm.bmHeight, NULL, bi, DIB_RGB_COLORS);
res = CreateDIBSection(dc, bi, DIB_RGB_COLORS, &bits, NULL, 0);
DeleteDC(dc);
@@ -2753,8 +2752,8 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
/* The source bitmap is a DIB section.
Get its attributes */
HDC dc = CreateCompatibleDC(NULL);
- bi->bmiHeader.biSize = sizeof(bi->bmiHeader);
- bi->bmiHeader.biBitCount = ds.dsBm.bmBitsPixel;
+ bi->bmiHeader.biWidth = ds.dsBm.bmWidth;
+ bi->bmiHeader.biHeight = ds.dsBm.bmHeight;
GetDIBits(dc, hnd, 0, ds.dsBm.bmHeight, NULL, bi, DIB_RGB_COLORS);
DeleteDC(dc);
More information about the wine-cvs
mailing list