[PATCH 0/1] MR11160: gdi.exe: Don't use biSizeImage when calculating DIB pitch.
From: Dmitry Timoshkov <dmitry@baikal.ru> An application may set biSizeImage to 0. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59871 Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/gdi.exe16/gdi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/gdi.exe16/gdi.c b/dlls/gdi.exe16/gdi.c index 564b0484857..38b0b12ea89 100644 --- a/dlls/gdi.exe16/gdi.c +++ b/dlls/gdi.exe16/gdi.c @@ -1190,12 +1190,13 @@ HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output, { .Width = info->bmiHeader.biWidth, .Height = abs( info->bmiHeader.biHeight ), - .Pitch = info->bmiHeader.biSizeImage / abs( info->bmiHeader.biHeight ), }; struct saved_bitmap *bitmap; UINT status; int color; + desc.Pitch = ((info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) >> 3) & ~3; + if (info->bmiHeader.biBitCount <= 8) { if (info->bmiHeader.biClrUsed) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11160
participants (2)
-
Dmitry Timoshkov -
Dmitry Timoshkov (@dmitry)