Prevent bomb when GDI_ObjPtr returns null object.

This commit is contained in:
Guy L. Albertelli 2001-09-07 15:28:10 +00:00 committed by Alexandre Julliard
parent 92bb19fed8
commit 342b5a861a
1 changed files with 8 additions and 2 deletions

View File

@ -595,8 +595,14 @@ Pixmap X11DRV_BITMAP_Pixmap(HBITMAP hbitmap)
{
Pixmap pixmap;
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
if (bmp) {
pixmap = (Pixmap)bmp->physBitmap;
GDI_ReleaseObj( hbitmap );
}
else {
ERR("handle %08x returned no obj\n", hbitmap);
pixmap = 0;
}
return pixmap;
}