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

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;
}
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 );
}