Commit 294faf5e authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Check that the bitmap depth matches the DC when selecting it.

parent fdc4682e
......@@ -507,6 +507,15 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
goto done;
}
if (bitmap->dib.dsBm.bmBitsPixel != 1 &&
bitmap->dib.dsBm.bmBitsPixel != GetDeviceCaps( hdc, BITSPIXEL ))
{
WARN( "Wrong format bitmap %u bpp\n", bitmap->dib.dsBm.bmBitsPixel );
GDI_ReleaseObj( handle );
ret = 0;
goto done;
}
if (dc->dibdrv) old_physdev = pop_dc_driver( dc, dc->dibdrv );
physdev = GET_DC_PHYSDEV( dc, pSelectBitmap );
......
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