hw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()
Avoid a null dereference of DIB_pixels if CreateDIBSection() fails in NetWMToWinIconAlpha() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
71b5f56302
commit
9fe360bf2b
|
@ -257,6 +257,10 @@ NetWMToWinIconAlpha(uint32_t * icon)
|
|||
DIB_RGB_COLORS, (void **) &DIB_pixels, NULL,
|
||||
0);
|
||||
ReleaseDC(NULL, hdc);
|
||||
|
||||
if (!ii.hbmColor)
|
||||
return NULL;
|
||||
|
||||
ii.hbmMask = CreateBitmap(width, height, 1, 1, NULL);
|
||||
memcpy(DIB_pixels, pixels, height * width * 4);
|
||||
|
||||
|
|
Loading…
Reference in New Issue