diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 14e09e7cc47..265b3363ca9 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -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);