mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-27 18:48:46 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user