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>
This commit is contained in:
parent
31605eb417
commit
7bb5b074b5
|
@ -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 );
|
nb_points = REGION_CreateEdgeTable( Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock, clip_rect );
|
||||||
if ((obj = alloc_region( nb_points / 2 )))
|
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, ®ion_funcs )))
|
if (!(hrgn = alloc_gdi_handle( obj, OBJ_REGION, ®ion_funcs )))
|
||||||
free_region( obj );
|
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_mixed[] = { {0, 0}, {0, 0}, {0, 0}, {6, 6}, {6, 6}, {6, 6} };
|
||||||
POINT points_six[] = { {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_line[] = { {1, 0}, {11, 0}, {21, 0}};
|
||||||
|
POINT points_overflow[] = { {0, 0}, {1, 0}, {0, 0x80000000} };
|
||||||
INT counts_single_poly[] = { 3 };
|
INT counts_single_poly[] = { 3 };
|
||||||
INT counts_two_poly[] = { 3, 3 };
|
INT counts_two_poly[] = { 3, 3 };
|
||||||
|
INT counts_overflow[] = { ARRAY_SIZE(points_overflow) };
|
||||||
int ret;
|
int ret;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
|
@ -543,6 +545,13 @@ static void test_CreatePolyPolygonRgn(void)
|
||||||
ret = GetRgnBox(region, &rect);
|
ret = GetRgnBox(region, &rect);
|
||||||
ok (ret == NULLREGION, "Expected NULLREGION, got %d\n", ret);
|
ok (ret == NULLREGION, "Expected NULLREGION, got %d\n", ret);
|
||||||
DeleteObject(region);
|
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)
|
START_TEST(clipping)
|
||||||
|
|
Loading…
Reference in New Issue