]> granicus.if.org Git - postgis/commitdiff
Fix unchecked return from _lwt_CheckEdgeCrossing (#3225)
authorSandro Santilli <strk@keybit.net>
Tue, 4 Aug 2015 18:36:06 +0000 (18:36 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 4 Aug 2015 18:36:06 +0000 (18:36 +0000)
NOTE: only affects clients that do not long-jump out on lwerror
      (ie: PostGIS is unaffected)

git-svn-id: http://svn.osgeo.org/postgis/trunk@13876 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_topo.c

index 44911c806d263e21a2a6373a3d313af6c4a318cc..87c1eaef1f8fd02a1bc8dfd69a3f61d84ebf7be5 100644 (file)
@@ -473,7 +473,7 @@ lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face,
 
 /* Check that an edge does not cross an existing node or edge
  *
- * Return -1 on cross, 0 if everything is fine.
+ * Return -1 on cross or error, 0 if everything is fine.
  * Note that before returning -1, lwerror is invoked...
  */
 static int
@@ -764,7 +764,10 @@ lwt_AddIsoEdge( LWT_TOPOLOGY* topo, LWT_ELEMID startNode,
   }
 
   if ( ! skipISOChecks )
-    _lwt_CheckEdgeCrossing( topo, startNode, endNode, geom );
+  {
+    if ( _lwt_CheckEdgeCrossing( topo, startNode, endNode, geom ) )
+      return -1;
+  }
 
   /*
    * All checks passed, time to prepare the new edge
@@ -2138,7 +2141,8 @@ _lwt_AddEdge( LWT_TOPOLOGY* topo,
       }
     }
 
-    _lwt_CheckEdgeCrossing( topo, start_node, end_node, geom );
+    if ( _lwt_CheckEdgeCrossing( topo, start_node, end_node, geom ) )
+      return -1;
 
   } /* ! skipChecks */