winex11: Handle error situation earlier in X11DRV_GetDIBits().
This commit is contained in:
parent
de1b44892d
commit
1f2611607f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue