winex11.drv: Try to work around an access violation (try 3)

Louis. Lenders xerox_xerox2000 at yahoo.co.uk
Sun Apr 1 13:53:48 CDT 2007


Skipped content of type multipart/alternative-------------- next part --------------
diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c
index c921034..b9bd320 100644
--- a/dlls/winex11.drv/dib.c
+++ b/dlls/winex11.drv/dib.c
@@ -39,6 +39,7 @@
 #include "wingdi.h"
 #include "x11drv.h"
 #include "excpt.h"
+#include "wine/exception.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(bitmap);
@@ -3508,6 +3509,8 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
           bmpImage->depth,bmpImage->bits_per_pixel,
           bmpImage->red_mask,bmpImage->green_mask,bmpImage->blue_mask);
 
+    __TRY
+    {
       /* Transfer the pixels */
     switch(descr->infoBpp)
     {
@@ -3586,6 +3589,13 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
         XPutImage( gdi_display, descr->drawable, descr->gc, bmpImage,
 		   descr->xSrc, descr->ySrc, descr->xDest, descr->yDest,
 		   descr->width, descr->height );
+    }
+    __EXCEPT_PAGE_FAULT 
+    {
+        lines = 0;
+        WARN("returning 0, application passed in an invalid pointer\n");
+    } 
+    __ENDTRY
 
     if (!descr->image) XDestroyImage( bmpImage );
     wine_tsx11_unlock();


More information about the wine-patches mailing list