Commit 0f6a66e9 authored by Bernhard Übelacker's avatar Bernhard Übelacker Committed by Alexandre Julliard

wing32: Avoid crash in WinGGetDIBPointer when called with NULL bitmap info.

parent edf0635e
......@@ -51,6 +51,9 @@ static void test_WinGGetDIBPointer(void)
dib = WinGGetDIBPointer(NULL, NULL);
ok(dib == NULL, "WinGGetDIBPointer returned unexpected value %p\n", dib);
dib = WinGGetDIBPointer(bmp, NULL);
ok(dib != NULL, "WinGGetDIBPointer failed\n");
dib = WinGGetDIBPointer(bmp, &bmi);
ok(dib != NULL, "WinGGetDIBPointer failed\n");
......
......@@ -72,7 +72,7 @@ void * WINAPI WinGGetDIBPointer( HBITMAP hbmp, BITMAPINFO *bmi )
if (GetObjectW( hbmp, sizeof(ds), &ds ) == sizeof(ds))
{
bmi->bmiHeader = ds.dsBmih;
if (bmi) bmi->bmiHeader = ds.dsBmih;
return ds.dsBm.bmBits;
}
return 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