Module: wine Branch: master Commit: 1f2611607f33cd1172fed1189962553437b83292 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f2611607f33cd1172fed11899...
Author: Gerald Pfeifer gerald@pfeifer.com Date: Sun Nov 1 01:11:09 2009 +0100
winex11: Handle error situation earlier in X11DRV_GetDIBits().
---
dlls/winex11.drv/dib.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index 1fc8812..587c7c7 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -4096,6 +4096,11 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start if (!(obj_size = GetObjectW( hbitmap, sizeof(dib), &dib ))) return 0;
bitmap_type = DIB_GetBitmapInfo( (BITMAPINFOHEADER*)info, &width, &tempHeight, &descr.infoBpp, &descr.compression); + if (bitmap_type == -1) + { + ERR("Invalid bitmap\n"); + return 0; + }
if (physBitmap->pixmap_depth > 1) { @@ -4107,11 +4112,6 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start palette[1] = peWhite; }
- if (bitmap_type == -1) - { - ERR("Invalid bitmap\n"); - return 0; - } descr.lines = tempHeight; core_header = (bitmap_type == 0); colorPtr = (LPBYTE) info + (WORD) info->bmiHeader.biSize;