gdi32: Skip scan conversion on overflow.

Fixes a regression introduced by 9bc6f004ce,
which broke when REGION_CreateEdgeTable overflowed.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Gabriel Ivăncescu 2020-06-09 10:54:49 +01:00 committed by Alexandre Julliard
parent 31605eb417
commit 7bb5b074b5
2 changed files with 10 additions and 1 deletions

View File

@ -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 );

View File

@ -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)