[geos-commits] r3217 - trunk/src/operation/overlay/snap
svn_geos at osgeo.org
svn_geos at osgeo.org
Sun Feb 13 17:31:03 EST 2011
Author: strk
Date: 2011-02-13 14:31:03 -0800 (Sun, 13 Feb 2011)
New Revision: 3217
Modified:
trunk/src/operation/overlay/snap/LineStringSnapper.cpp
Log:
Guard againts empty vectors before decrementing .end()
Modified: trunk/src/operation/overlay/snap/LineStringSnapper.cpp
===================================================================
--- trunk/src/operation/overlay/snap/LineStringSnapper.cpp 2011-02-13 22:30:55 UTC (rev 3216)
+++ trunk/src/operation/overlay/snap/LineStringSnapper.cpp 2011-02-13 22:31:03 UTC (rev 3217)
@@ -63,6 +63,8 @@
LineStringSnapper::snapVertices(geom::CoordinateList& srcCoords,
const geom::Coordinate::ConstVect& snapPts)
{
+ if ( srcCoords.empty() ) return;
+
using geom::CoordinateList;
geom::Coordinate::ConstVect::const_iterator not_found = snapPts.end();
@@ -170,6 +172,9 @@
cerr << " Snapping segment from: " << srcCoords << endl;
#endif
+ // nothing to do if there are no source coords..
+ if ( srcCoords.empty() ) return;
+
for ( Coordinate::ConstVect::const_iterator
it=snapPts.begin(), end=snapPts.end();
it != end;
More information about the geos-commits
mailing list