Commit 7bb5b074 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

gdi32: Skip scan conversion on overflow.

Fixes a regression introduced by 9bc6f004, which broke when REGION_CreateEdgeTable overflowed. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 31605eb4
......@@ -2742,7 +2742,7 @@ HRGN create_polypolygon_region( const POINT *Pts, const INT *Count, INT nbpolygo
nb_points = REGION_CreateEdgeTable( Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock, clip_rect );
if ((obj = alloc_region( nb_points / 2 )))
{
scan_convert( obj, &ET, mode, clip_rect );
if (nb_points) scan_convert( obj, &ET, mode, clip_rect );
if (!(hrgn = alloc_gdi_handle( obj, OBJ_REGION, &region_funcs )))
free_region( obj );
......
......@@ -513,8 +513,10 @@ static void test_CreatePolyPolygonRgn(void)
POINT points_mixed[] = { {0, 0}, {0, 0}, {0, 0}, {6, 6}, {6, 6}, {6, 6} };
POINT points_six[] = { {6, 6}, {6, 6}, {6, 6} };
POINT points_line[] = { {1, 0}, {11, 0}, {21, 0}};
POINT points_overflow[] = { {0, 0}, {1, 0}, {0, 0x80000000} };
INT counts_single_poly[] = { 3 };
INT counts_two_poly[] = { 3, 3 };
INT counts_overflow[] = { ARRAY_SIZE(points_overflow) };
int ret;
RECT rect;
......@@ -543,6 +545,13 @@ static void test_CreatePolyPolygonRgn(void)
ret = GetRgnBox(region, &rect);
ok (ret == NULLREGION, "Expected NULLREGION, got %d\n", ret);
DeleteObject(region);
/* Test with points that overflow the edge table */
region = CreatePolyPolygonRgn(points_overflow, counts_overflow, ARRAY_SIZE(counts_overflow), ALTERNATE);
ok (region != NULL, "region must not be NULL\n");
ret = GetRgnBox(region, &rect);
ok (ret == NULLREGION, "Expected NULLREGION, got %d\n", ret);
DeleteObject(region);
}
START_TEST(clipping)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment