Commit 7990b7c0 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed CreateCompatibleBitmap when called with 0 width or height.

parent 350075fd
...@@ -183,7 +183,11 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height) ...@@ -183,7 +183,11 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height)
FIXME_(bitmap)("got bad width %d or height %d, please look for reason\n", FIXME_(bitmap)("got bad width %d or height %d, please look for reason\n",
width, height ); width, height );
} else { } else {
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL ); /* MS doc says if width or height is 0, return 1-by-1 pixel, monochrome bitmap */
if (!width || !height)
hbmpRet = CreateBitmap( 1, 1, 1, 1, NULL );
else
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
if(dc->funcs->pCreateBitmap) if(dc->funcs->pCreateBitmap)
dc->funcs->pCreateBitmap( hbmpRet ); dc->funcs->pCreateBitmap( hbmpRet );
} }
......
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