gdi32: CreateDIBitmap should check for SetDIBits failure.

This commit is contained in:
Lei Zhang 2008-07-18 15:28:44 -07:00 committed by Alexandre Julliard
parent e031ef4807
commit ce552d4451
1 changed files with 8 additions and 1 deletions

View File

@ -1118,7 +1118,14 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
if (handle)
{
if (init == CBM_INIT) SetDIBits( hdc, handle, 0, height, bits, data, coloruse );
if (init == CBM_INIT)
{
if (SetDIBits( hdc, handle, 0, height, bits, data, coloruse ) == 0)
{
DeleteObject( handle );
handle = 0;
}
}
else if (hdc && ((dc = get_dc_ptr( hdc )) != NULL) )
{