From c24172433751b7bcd97c9922691f8a4606a066d4 Mon Sep 17 00:00:00 2001 From: strk Date: Tue, 5 Jul 2011 09:43:42 +0000 Subject: [PATCH] Avoid segfalting when an added node has no label in GeometryGraph::insertBoundaryPoint. See https://sourceforge.net/tracker /?func=detail&aid=3353879&group_id=128875&atid=713120 git-svn-id: http://svn.osgeo.org/geos/branches/3.3@3403 5242fede-7e19-0410-aef8-94bd7d2200fb --- src/geomgraph/GeometryGraph.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/geomgraph/GeometryGraph.cpp b/src/geomgraph/GeometryGraph.cpp index 5103616d..94fffbc4 100644 --- a/src/geomgraph/GeometryGraph.cpp +++ b/src/geomgraph/GeometryGraph.cpp @@ -422,9 +422,11 @@ GeometryGraph::insertBoundaryPoint(int argIndex,const Coordinate& coord) // the new point to insert is on a boundary int boundaryCount=1; + // determine the current location for the point (if any) - int loc=Location::UNDEF; - if (lbl!=NULL) loc=lbl->getLocation(argIndex,Position::ON); + if ( NULL == lbl ) return; + + int loc = lbl->getLocation(argIndex,Position::ON); if (loc==Location::BOUNDARY) boundaryCount++; // determine the boundary status of the point according to the -- 2.11.4.GIT