Commit 1f261160 authored by Gerald Pfeifer's avatar Gerald Pfeifer Committed by Alexandre Julliard

winex11: Handle error situation earlier in X11DRV_GetDIBits().

parent de1b4489
...@@ -4096,6 +4096,11 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start ...@@ -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; if (!(obj_size = GetObjectW( hbitmap, sizeof(dib), &dib ))) return 0;
bitmap_type = DIB_GetBitmapInfo( (BITMAPINFOHEADER*)info, &width, &tempHeight, &descr.infoBpp, &descr.compression); 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) if (physBitmap->pixmap_depth > 1)
{ {
...@@ -4107,11 +4112,6 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start ...@@ -4107,11 +4112,6 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
palette[1] = peWhite; palette[1] = peWhite;
} }
if (bitmap_type == -1)
{
ERR("Invalid bitmap\n");
return 0;
}
descr.lines = tempHeight; descr.lines = tempHeight;
core_header = (bitmap_type == 0); core_header = (bitmap_type == 0);
colorPtr = (LPBYTE) info + (WORD) info->bmiHeader.biSize; colorPtr = (LPBYTE) info + (WORD) info->bmiHeader.biSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment