From: Fabian Maurer Subject: [PATCH 2/2] gdi32: create_polypolygon_region should return empty region when area is empty Message-Id: <20190519120542.23906-2-dark.shadow4@web.de> Date: Sun, 19 May 2019 14:05:42 +0200 In-Reply-To: <20190519120542.23906-1-dark.shadow4@web.de> References: <20190519120542.23906-1-dark.shadow4@web.de> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46655 Signed-off-by: Fabian Maurer --- dlls/gdi32/region.c | 3 +-- dlls/gdi32/tests/region.c | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index cad6428dc9..93238b5a84 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -2627,8 +2627,7 @@ HRGN create_polypolygon_region( const POINT *Pts, const INT *Count, INT nbpolygo if (! (pETEs = HeapAlloc( GetProcessHeap(), 0, sizeof(EdgeTableEntry) * total ))) return 0; - if (!(nb_points = REGION_CreateEdgeTable( Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock, clip_rect ))) - goto done; + nb_points = REGION_CreateEdgeTable( Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock, clip_rect ); if (!(obj = alloc_region( nb_points / 2 ))) goto done; diff --git a/dlls/gdi32/tests/region.c b/dlls/gdi32/tests/region.c index 90f91d4440..711671a64f 100644 --- a/dlls/gdi32/tests/region.c +++ b/dlls/gdi32/tests/region.c @@ -42,22 +42,18 @@ static void test_CreatePolyPolygonRgn(void) /* When all polygons are just one point or line, return must not be NULL */ region = CreatePolyPolygonRgn(points_zero, counts_single_poly, ARRAY_SIZE(counts_single_poly), ALTERNATE); - todo_wine ok (region != NULL, "region must not be NULL\n"); DeleteObject(region); region = CreatePolyPolygonRgn(points_six, counts_single_poly, ARRAY_SIZE(counts_single_poly), ALTERNATE); - todo_wine ok (region != NULL, "region must not be NULL\n"); DeleteObject(region); region = CreatePolyPolygonRgn(points_line, counts_single_poly, ARRAY_SIZE(counts_single_poly), ALTERNATE); - todo_wine ok (region != NULL, "region must not be NULL\n"); DeleteObject(region); region = CreatePolyPolygonRgn(points_mixed, counts_two_poly, ARRAY_SIZE(counts_two_poly), ALTERNATE); - todo_wine ok (region != NULL, "region must not be NULL\n"); DeleteObject(region); } -- 2.21.0