gdi32: Avoid exceeding the actual bitmap height.

The bottom-up case is handled earlier on.  For the top-down
case, 'lines' is left untouched.

Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Haoyang Chen 2020-11-12 10:38:15 +00:00 committed by Alexandre Julliard
parent 176ca7b87b
commit abd0cddc5f
1 changed files with 1 additions and 1 deletions

View File

@ -824,7 +824,7 @@ INT CDECL nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx
} }
else if (src.y >= lines) return lines; else if (src.y >= lines) return lines;
} }
src_info->bmiHeader.biHeight = top_down ? -lines : lines; src_info->bmiHeader.biHeight = top_down ? -min( lines, height ) : lines;
src_info->bmiHeader.biSizeImage = get_dib_image_size( src_info ); src_info->bmiHeader.biSizeImage = get_dib_image_size( src_info );
} }