[PATCH 0/2] MR7280: gdiplus/tests: Extend a GdipGetPathGradientBlend() test with excessive output buffer size.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7280
From: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/gdiplus/tests/brush.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index f79eb7bbedc..dc374eaa65b 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -1663,8 +1663,14 @@ static void test_pathgradientblend(void) expectf(positions[i], res_positions[i]); } + res_factors[5] = 123.0f; + res_positions[5] = 456.0f; status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 6); expect(Ok, status); + todo_wine + ok(res_factors[5] == 123.0f, "Unexpected value %f.\n", res_factors[5]); + todo_wine + ok(res_positions[5] == 456.0f, "Unexpected value %f.\n", res_positions[5]); status = GdipSetPathGradientBlend(brush, factors, positions, 1); expect(Ok, status); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7280
From: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/gdiplus/brush.c | 4 ++-- dlls/gdiplus/tests/brush.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 1f080648f9c..19722629e3d 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1060,9 +1060,9 @@ GpStatus WINGDIPAPI GdipGetPathGradientBlend(GpPathGradient *brush, REAL *blend, if(count < brush->blendcount) return InsufficientBuffer; - memcpy(blend, brush->blendfac, count*sizeof(REAL)); + memcpy(blend, brush->blendfac, brush->blendcount*sizeof(REAL)); if(brush->blendcount > 1){ - memcpy(positions, brush->blendpos, count*sizeof(REAL)); + memcpy(positions, brush->blendpos, brush->blendcount*sizeof(REAL)); } return Ok; diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index dc374eaa65b..ad2712fae34 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -1667,9 +1667,7 @@ static void test_pathgradientblend(void) res_positions[5] = 456.0f; status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 6); expect(Ok, status); - todo_wine ok(res_factors[5] == 123.0f, "Unexpected value %f.\n", res_factors[5]); - todo_wine ok(res_positions[5] == 456.0f, "Unexpected value %f.\n", res_positions[5]); status = GdipSetPathGradientBlend(brush, factors, positions, 1); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7280
This merge request was approved by Esme Povirk. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7280
participants (3)
-
Esme Povirk (@madewokherd) -
Nikolay Sivov -
Nikolay Sivov (@nsivov)