winex11: Handle error situation earlier in X11DRV_GetDIBits().

This commit is contained in:
Gerald Pfeifer 2009-11-01 01:11:09 +01:00 committed by Alexandre Julliard
parent de1b44892d
commit 1f2611607f
1 changed files with 5 additions and 5 deletions

View File

@ -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
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;