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/qgis@10689 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 30, 2009
1 parent 5c52875 commit 6257e1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/qgsgeometry.cpp
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 6257e1f

Please sign in to comment.