[PATCH 0/1] MR8218: gdiplus/tests: Make sure stride is correct for GdipCreateBitmapFromScan0.
We use 4*3 as the stride for GdipCreateBitmapFromScan0 in all test cases in test_CloneBitmapArea, but bmp_3x3_data_24bpp_rgb only has 9 bytes per row. GdipCreateBitmapFromScan0 also expects the stride to be a multiple of 4, so pad bmp_3x3_data_24bpp_rgb to be 12 bytes per row. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218
From: Yuxuan Shui <yshui(a)codeweavers.com> We use 4*3 as the stride for GdipCreateBitmapFromScan0 in all test cases in test_CloneBitmapArea, but bmp_3x3_data_24bpp_rgb only has 9 bytes per row. GdipCreateBitmapFromScan0 also expects the stride to be a multiple of 4, so pad bmp_3x3_data_24bpp_rgb to be 12 bytes per row. --- dlls/gdiplus/tests/image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index f6d79059a59..e3602ceb505 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -5330,9 +5330,9 @@ static void test_CloneBitmapArea(void) 0xff,0xff,0xff,0x00, 0x80,0x80,0x80,0x00, 0x00,0x00,0x00,0x00 }; static BYTE bmp_3x3_data_24bpp_rgb[] = { - 0xff,0x00,0x00, 0x00,0xff,0x00, 0x00,0x00,0xff, - 0xff,0xff,0x00, 0x00,0xff,0xff, 0xff,0x00,0xff, - 0xff,0xff,0xff, 0x80,0x80,0x80, 0x00,0x00,0x00 + 0xff,0x00,0x00, 0x00,0xff,0x00, 0x00,0x00,0xff, 0x00,0x00,0x00, + 0xff,0xff,0x00, 0x00,0xff,0xff, 0xff,0x00,0xff, 0x00,0x00,0x00, + 0xff,0xff,0xff, 0x80,0x80,0x80, 0x00,0x00,0x00, 0x00,0x00,0x00 }; static const struct test_data { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8218
This merge request was approved by Jinoh Kang. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218
Why doesn't this affect the test results? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218#note_105677
On Fri Jun 6 17:55:35 2025 +0000, Esme Povirk wrote:
Why doesn't this affect the test results? the result is compared using GdipBitmapGetPixel from the original and the clone. GdipBitmapGetPixel also reads out-of-bound and with the wrong stride.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218#note_105681
On Fri Jun 6 17:55:35 2025 +0000, Yuxuan Shui wrote:
the result is compared using GdipBitmapGetPixel from the original and the clone. GdipBitmapGetPixel also reads out-of-bound and with the wrong stride. The test doesn't care about the actual pixel values, even if they are garbage values beyond end of the array.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218#note_105683
On Fri Jun 6 21:18:47 2025 +0000, Jinoh Kang wrote:
The test doesn't care about the actual pixel values, even if they are garbage values beyond end of the array. Makes sense, thanks.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218#note_105697
This merge request was approved by Esme Povirk. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8218
participants (4)
-
Esme Povirk (@madewokherd) -
Jinoh Kang (@iamahuman) -
Yuxuan Shui -
Yuxuan Shui (@yshui)