No subject


Fri Sep 18 15:31:18 CDT 2009


two variables being passed by addresses which in turns forwards to 
DIB_GetBitmapInfoEx().  And there we have a default case of

    ERR("(%d): unknown/wrong size for header\n", header->biSize );
    return -1;

where indeed height and width are not initialized, so GCC 4.5 is right.

If you prefer, the patch below addresses this there; it is the only
alternative to my original submission of
  http://www.winehq.org/pipermail/wine-patches/2009-October/080120.html
that comes to my mind.  If you have any other idea, I'd be happy to
look into that, of course.


Gerald


ChangeLog:
Initialize width and height in the error case of DIB_GetBitmapInfoEx.

diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c
index 7601afc..5382de1 100644
--- a/dlls/winex11.drv/dib.c
+++ b/dlls/winex11.drv/dib.c
@@ -272,7 +272,7 @@ static int DIB_GetBitmapInfoEx( const BITMAPINFOHEADER *header, LONG *width,
         *size   = 0;
         return 0;
     }
-    if (header->biSize >= sizeof(BITMAPINFOHEADER))
+    else if (header->biSize >= sizeof(BITMAPINFOHEADER))
     {
         *width  = header->biWidth;
         *height = header->biHeight;
@@ -283,6 +283,7 @@ static int DIB_GetBitmapInfoEx( const BITMAPINFOHEADER *header, LONG *width,
         return 1;
     }
     ERR("(%d): unknown/wrong size for header\n", header->biSize );
+    *width = *height = 0;
     return -1;
 }
 



More information about the wine-patches mailing list