PATCH: handle NULL XImage in GetBitmapBits

Marcus Meissner marcus at jet.franken.de
Sun Dec 11 13:49:30 CST 2005


Hi,

This fixes bug 4034.
XGetImage() returns NULL since we can pass a 0 height value. (298 bytes
vs 320 byte wide image).

Ciao, Marcus

Changelog:
	Check return value of XGetImage().

Index: dlls/x11drv/bitmap.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/bitmap.c,v
retrieving revision 1.18
diff -u -r1.18 bitmap.c
--- dlls/x11drv/bitmap.c	26 Sep 2005 11:04:12 -0000	1.18
+++ dlls/x11drv/bitmap.c	11 Dec 2005 19:43:38 -0000
@@ -181,6 +181,10 @@
 
     image = XGetImage( gdi_display, physBitmap->pixmap, 0, 0,
                        bitmap.bmWidth, bitmap.bmHeight, AllPlanes, ZPixmap );
+    if (!image) {
+        wine_tsx11_unlock();
+        return 0;
+    }
     bitmap.bmHeight = old_height;
 
     /* copy XImage to 16 bit padded image buffer with real bitsperpixel */



More information about the wine-patches mailing list