Module: wine Branch: master Commit: cf7cfa85eb14a40e35709c3cdfece56290702f0b URL: http://source.winehq.org/git/wine.git/?a=commit;h=cf7cfa85eb14a40e35709c3cdf...
Author: Peter Dons Tychsen donpedro@dhcppc2 Date: Tue Jun 26 15:39:30 2007 +0200
winex11: Fix X11DRV_DIB_GetImageBits() when target bitmaps are larger than fetched.
---
dlls/winex11.drv/dib.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index c921034..00b1f23 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -3618,7 +3618,11 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) }
#ifdef HAVE_LIBXXSHM - if (descr->image && descr->useShm) + + /* We must not call XShmGetImage() with a bitmap which is bigger than the avilable area. + If we do, XShmGetImage() will fail (X exception), as it checks for this internally. */ + if((descr->image && descr->useShm) && (bmpImage->width <= (descr->width - descr->xSrc)) + && (bmpImage->height <= (descr->height - descr->ySrc))) { int saveRed, saveGreen, saveBlue;