]> granicus.if.org Git - postgis/commitdiff
Handle exceptions from GEOSUnionCascaded() in LWGEOM_GEOS_buildArea
authorSandro Santilli <strk@keybit.net>
Fri, 25 May 2012 15:20:50 +0000 (15:20 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 25 May 2012 15:20:50 +0000 (15:20 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9821 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_geos.c

index 88cfbce3934eeeb0e1a34e040b2d225140bbac73..74fe45e36681fe9a7589a84d5a9ffb2e4a6542bd 100644 (file)
@@ -1018,6 +1018,11 @@ LWGEOM_GEOS_buildArea(const GEOSGeometry* geom_in)
 
   /* Run a single overlay operation to dissolve shared edges */
   shp = GEOSUnionCascaded(tmp);
+  if ( ! shp )
+  {
+    GEOSGeom_destroy(tmp);
+    return 0; /* exception */
+  }
 
 #ifdef LWGEOM_PROFILE_BUILDAREA
   lwnotice("Final cleanup");