From e845fd9c59967bc6f7de2f6ee78c6f63a2a8a7de Mon Sep 17 00:00:00 2001 From: Warren Baird Date: Wed, 8 Oct 2003 02:54:15 +0000 Subject: [PATCH] Handle cases where XGetImage or X11DRV_DIB_CreateXImage fail. --- graphics/x11drv/bitblt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/graphics/x11drv/bitblt.c b/graphics/x11drv/bitblt.c index 4dff6b09f7b..6dad5567d82 100644 --- a/graphics/x11drv/bitblt.c +++ b/graphics/x11drv/bitblt.c @@ -1009,7 +1009,16 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe physDevSrc->org.x + visRectSrc->left, physDevSrc->org.y + visRectSrc->top, width, height, AllPlanes, ZPixmap ); + if (!imageSrc) + { + return exposures; + } imageDst = X11DRV_DIB_CreateXImage( width, height, dcDst->bitsPerPixel ); + if (!imageDst) + { + XDestroyImage(imageSrc); + return exposures; + } for (y = 0; y < height; y++) for (x = 0; x < width; x++) XPutPixel(imageDst, x, y, (XGetPixel(imageSrc,x,y) ==