[PATCH 0/1] MR6942: gdiplus: Use the FormatID of the source image when cloning.
From: Haoyang Chen <chenhaoyang(a)kylinos.cn> --- dlls/gdiplus/image.c | 1 + dlls/gdiplus/tests/image.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 65a179ec037..6e55113dbce 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1337,6 +1337,7 @@ GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height, stat = GdipCreateBitmapFromScan0(area.Width, area.Height, 0, format, NULL, dstBitmap); if (stat == Ok) { + memcpy(&(*dstBitmap)->image.format, &srcBitmap->image.format, sizeof(GUID)); stat = convert_pixels(area.Width, area.Height, (*dstBitmap)->stride, (*dstBitmap)->bits, (*dstBitmap)->format, (*dstBitmap)->image.palette, srcBitmap->stride, srcBitmap->bits + srcBitmap->stride * area.Y + PIXELFORMATBPP(srcBitmap->format) * area.X / 8, diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index fafbfdab113..50c76346357 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -180,7 +180,7 @@ static void test_bufferrawformat(void* buff, int size, REFGUID expected, int lin LPBYTE data; HRESULT hres; GpStatus stat; - GpImage *img; + GpImage *img, *copy; hglob = GlobalAlloc (0, size); data = GlobalLock (hglob); @@ -199,8 +199,12 @@ static void test_bufferrawformat(void* buff, int size, REFGUID expected, int lin } expect_rawformat(expected, img, line, todo); + stat = GdipCloneImage(img, ©); + expect(Ok, stat); + expect_rawformat(expected, copy, line, todo); GdipDisposeImage(img); + GdipDisposeImage(copy); IStream_Release(stream); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6942
This merge request was approved by Esme Povirk. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6942
participants (3)
-
Esme Povirk (@madewokherd) -
Haoyang Chen -
Haoyang Chen (@chenhaoyang)