Commit 0f9bc1d3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Check header pointer in CreateDIBitmap.

parent 1b1e0027
......@@ -1097,6 +1097,8 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
DWORD compr, size;
DC *dc;
if (!header) return 0;
if (DIB_GetBitmapInfo( header, &width, &height, &planes, &bpp, &compr, &size ) == -1) return 0;
if (width < 0)
......
......@@ -145,6 +145,11 @@ static void test_createdibitmap(void)
bmih.biBitCount = 32;
bmih.biCompression = BI_RGB;
hbm = CreateDIBitmap(hdc, NULL, CBM_INIT, NULL, NULL, 0);
ok(hbm == NULL, "CreateDIBitmap should fail\n");
hbm = CreateDIBitmap(hdc, NULL, 0, NULL, NULL, 0);
ok(hbm == NULL, "CreateDIBitmap should fail\n");
/* First create an un-initialised bitmap. The depth of the bitmap
should match that of the hdc and not that supplied in bmih.
*/
......
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