PATCH: GdiAlphaBlend fix

Marcus Meissner marcus at jet.franken.de
Wed May 24 01:35:12 CDT 2006


Hi,

GdiAlphaBlend() causes X errors if width or height is 0.
Catch these values and fixme().

This is for bug 5161.

Ciao, Marcus

Index: dlls/gdi/bitblt.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/bitblt.c,v
retrieving revision 1.12
diff -u -r1.12 bitblt.c
--- dlls/gdi/bitblt.c	23 May 2006 12:47:58 -0000	1.12
+++ dlls/gdi/bitblt.c	24 May 2006 06:31:50 -0000
@@ -492,6 +492,13 @@
     BOOL ret = FALSE;
     DC *dcDst, *dcSrc;
 
+    if (!widthDst || !heightDst || !widthSrc || !heightSrc) {
+        FIXME("(height or widths must not be 0. dst=%dx%d, src=%dx%d\n",
+            widthDst, heightDst, widthSrc, heightSrc
+        );
+        return FALSE;
+    }
+
     if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) GDI_ReleaseObj( hdcSrc );
     /* FIXME: there is a race condition here */
     if ((dcDst = DC_GetDCUpdate( hdcDst )))



More information about the wine-patches mailing list