Skip to content

Commit

Permalink
Call function throwGeosException to avoid segfault with invalid ring …
Browse files Browse the repository at this point in the history
…geometries. Fixes bug #1667

git-svn-id: http://svn.osgeo.org/qgis/trunk@10689 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 30, 2009
1 parent ee7bb21 commit a94d57f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/qgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2659,11 +2659,15 @@ int QgsGeometry::addRing( const QList<QgsPoint>& ring )
{
newRing = createGeosLinearRing( ring.toVector() );
if ( !GEOSisValid( newRing ) )
throw GEOSException( "ring is invalid" );
{
throwGEOSException("ring is invalid");
}

newRingPolygon = createGeosPolygon( newRing );
if ( !GEOSisValid( newRingPolygon ) )
throw GEOSException( "ring polygon is invalid" );
{
throwGEOSException("ring is invalid");
}
}
catch ( GEOSException &e )
{
Expand Down

0 comments on commit a94d57f

Please sign in to comment.