Commit c6fd6b6a authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

user32/tests: Prevent writing to not allocated memory.

parent d2d8d71e
......@@ -593,9 +593,13 @@ static void test_CreateIcon(void)
bmpinfo.bmiHeader.biBitCount = 8;
bmpinfo.bmiHeader.biCompression = BI_RGB;
hbmColor = CreateDIBSection( hdc, &bmpinfo, DIB_RGB_COLORS, &bits, NULL, 0 );
ok(hbmColor != NULL, "Expected a handle to the DIB\n");
if (bits)
memset( bits, 0x55, 32 * 32 * bmpinfo.bmiHeader.biBitCount / 8 );
bmpinfo.bmiHeader.biBitCount = 1;
hbmMask = CreateDIBSection( hdc, &bmpinfo, DIB_RGB_COLORS, &bits, NULL, 0 );
ok(hbmMask != NULL, "Expected a handle to the DIB\n");
if (bits)
memset( bits, 0x55, 32 * 32 * bmpinfo.bmiHeader.biBitCount / 8 );
info.fIcon = TRUE;
......@@ -612,6 +616,8 @@ static void test_CreateIcon(void)
bmpinfo.bmiHeader.biBitCount = 16;
hbmColor = CreateDIBSection( hdc, &bmpinfo, DIB_RGB_COLORS, &bits, NULL, 0 );
ok(hbmColor != NULL, "Expected a handle to the DIB\n");
if (bits)
memset( bits, 0x55, 32 * 32 * bmpinfo.bmiHeader.biBitCount / 8 );
info.fIcon = TRUE;
......@@ -628,6 +634,8 @@ static void test_CreateIcon(void)
bmpinfo.bmiHeader.biBitCount = 32;
hbmColor = CreateDIBSection( hdc, &bmpinfo, DIB_RGB_COLORS, &bits, NULL, 0 );
ok(hbmColor != NULL, "Expected a handle to the DIB\n");
if (bits)
memset( bits, 0x55, 32 * 32 * bmpinfo.bmiHeader.biBitCount / 8 );
info.fIcon = TRUE;
......
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