Handle cases where XGetImage or X11DRV_DIB_CreateXImage fail.
This commit is contained in:
parent
87ae825bf8
commit
e845fd9c59
|
@ -1009,7 +1009,16 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
|
||||||
physDevSrc->org.x + visRectSrc->left,
|
physDevSrc->org.x + visRectSrc->left,
|
||||||
physDevSrc->org.y + visRectSrc->top,
|
physDevSrc->org.y + visRectSrc->top,
|
||||||
width, height, AllPlanes, ZPixmap );
|
width, height, AllPlanes, ZPixmap );
|
||||||
|
if (!imageSrc)
|
||||||
|
{
|
||||||
|
return exposures;
|
||||||
|
}
|
||||||
imageDst = X11DRV_DIB_CreateXImage( width, height, dcDst->bitsPerPixel );
|
imageDst = X11DRV_DIB_CreateXImage( width, height, dcDst->bitsPerPixel );
|
||||||
|
if (!imageDst)
|
||||||
|
{
|
||||||
|
XDestroyImage(imageSrc);
|
||||||
|
return exposures;
|
||||||
|
}
|
||||||
for (y = 0; y < height; y++)
|
for (y = 0; y < height; y++)
|
||||||
for (x = 0; x < width; x++)
|
for (x = 0; x < width; x++)
|
||||||
XPutPixel(imageDst, x, y, (XGetPixel(imageSrc,x,y) ==
|
XPutPixel(imageDst, x, y, (XGetPixel(imageSrc,x,y) ==
|
||||||
|
|
Loading…
Reference in New Issue