dlls/gdi/dib.c GetDIBits

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Tue May 31 19:32:59 CDT 2005


This patch fixes a regression that happened quite sometime ago. We don't
always fill in the BITMAPINFO struct fields on the way out and this
broke my app because it uses these values to allocate enough memory to hold
the bits.


ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    Make sure the out parameter, BITMAPINFO, gets populated
-------------- next part --------------
Index: dlls/gdi/dib.c
===================================================================
RCS file: /cvstrees/crossover/office/wine/dlls/gdi/dib.c,v
retrieving revision 1.10
diff -u -p -r1.10 dib.c
--- dlls/gdi/dib.c	19 Apr 2005 17:35:37 -0000	1.10
+++ dlls/gdi/dib.c	1 Jun 2005 00:24:08 -0000
@@ -946,32 +946,28 @@ INT WINAPI GetDIBits(
     }
     else
     {
-	/* fill in struct members */
-
-        if (bpp == 0)
+        /* fill in struct members */
+        if (core_header)
         {
-            if (core_header)
-            {
-                BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) info;
-                coreheader->bcWidth = bmp->bitmap.bmWidth;
-                coreheader->bcHeight = bmp->bitmap.bmHeight;
-                coreheader->bcPlanes = 1;
-                coreheader->bcBitCount = bmp->bitmap.bmBitsPixel;
-            }
-            else
-            {
-                info->bmiHeader.biWidth = bmp->bitmap.bmWidth;
-                info->bmiHeader.biHeight = bmp->bitmap.bmHeight;
-                info->bmiHeader.biPlanes = 1;
-                info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel;
-                info->bmiHeader.biSizeImage =
-                                 DIB_GetDIBImageBytes( bmp->bitmap.bmWidth,
+            BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) info;
+            coreheader->bcWidth = bmp->bitmap.bmWidth;
+            coreheader->bcHeight = bmp->bitmap.bmHeight;
+            coreheader->bcPlanes = 1;
+            coreheader->bcBitCount = bmp->bitmap.bmBitsPixel;
+        }
+        else
+        {
+            info->bmiHeader.biWidth = bmp->bitmap.bmWidth;
+            info->bmiHeader.biHeight = bmp->bitmap.bmHeight;
+            info->bmiHeader.biPlanes = 1;
+            info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel;
+            info->bmiHeader.biSizeImage =
+                DIB_GetDIBImageBytes( bmp->bitmap.bmWidth,
                                                        bmp->bitmap.bmHeight,
                                                        bmp->bitmap.bmBitsPixel );
-                info->bmiHeader.biCompression = 0;
-            }
-            lines = abs(bmp->bitmap.bmHeight);
+            info->bmiHeader.biCompression = 0;
         }
+        lines = abs(bmp->bitmap.bmHeight);
     }
 
     if (!core_header)


More information about the wine-patches mailing list