1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

gdiplus: Fix DIB stride calculation in GdipDrawImagePointsRect.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56800
This commit is contained in:
Esme Povirk 2024-06-11 16:21:36 +00:00 committed by Alexandre Julliard
parent be427c312b
commit 6753f25f58

View File

@ -3427,6 +3427,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
BITMAPINFOHEADER bih;
BYTE *temp_bits;
PixelFormat dst_format;
INT dib_stride;
src_hdc = CreateCompatibleDC(0);
@ -3453,8 +3454,10 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
hbitmap = CreateDIBSection(src_hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS,
(void**)&temp_bits, NULL, 0);
dib_stride = ((bitmap->width * PIXELFORMATBPP(dst_format) + 31) / 8) & ~3;
convert_pixels(bitmap->width, bitmap->height,
bitmap->width*PIXELFORMATBPP(dst_format)/8, temp_bits, dst_format, bitmap->image.palette,
dib_stride, temp_bits, dst_format, bitmap->image.palette,
bitmap->stride, bitmap->bits, bitmap->format,
bitmap->image.palette);