gdi32: Check header pointer in CreateDIBitmap.
This commit is contained in:
parent
1b1e0027db
commit
0f9bc1d3b7
|
@ -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)
|
||||
|
|
|
@ -144,7 +144,12 @@ static void test_createdibitmap(void)
|
|||
bmih.biPlanes = 1;
|
||||
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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue