From ba9576e7f2b67c0311352085fa961dc8fe69f0b4 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Wed, 22 Jun 2011 22:09:47 +0000 Subject: [PATCH] ST_ForceRHR POLYGON EMPTY crash (#710) git-svn-id: http://svn.osgeo.org/postgis/trunk@7446 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwpoly.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/liblwgeom/lwpoly.c b/liblwgeom/lwpoly.c index b05db7b2d..be6063ab0 100644 --- a/liblwgeom/lwpoly.c +++ b/liblwgeom/lwpoly.c @@ -503,18 +503,19 @@ lwpoly_force_clockwise(LWPOLY *poly) { int i; + /* No-op empties */ + if ( lwpoly_is_empty(poly) ) + return; + + /* External ring */ if ( ptarray_isccw(poly->rings[0]) ) - { ptarray_reverse(poly->rings[0]); - } + /* Internal rings */ for (i=1; inrings; i++) - { if ( ! ptarray_isccw(poly->rings[i]) ) - { ptarray_reverse(poly->rings[i]); - } - } + } void -- 2.50.1