Commit ce552d44 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

gdi32: CreateDIBitmap should check for SetDIBits failure.

parent e031ef48
......@@ -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) )
{
......
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