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.
From: Yuxuan Shui yshui@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 {
This merge request was approved by Jinoh Kang.
Why doesn't this affect the test results?
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.
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.
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.
This merge request was approved by Esme Povirk.