Skip to content
Permalink
Browse files

Fix crash in geometry collections with negative part numbers

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent b2bd0ac commit 0e908d5d5bbacef1106129df8714d56c4c99004a
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/geometry/qgsgeometrycollection.cpp
@@ -449,7 +449,7 @@ bool QgsGeometryCollection::insertVertex( QgsVertexId position, const QgsPoint &

bool QgsGeometryCollection::moveVertex( QgsVertexId position, const QgsPoint &newPos )
{
if ( position.part >= mGeometries.size() )
if ( position.part < 0 || position.part >= mGeometries.size() )
{
return false;
}
@@ -464,7 +464,7 @@ bool QgsGeometryCollection::moveVertex( QgsVertexId position, const QgsPoint &ne

bool QgsGeometryCollection::deleteVertex( QgsVertexId position )
{
if ( position.part >= mGeometries.size() )
if ( position.part < 0 || position.part >= mGeometries.size() )
{
return false;
}
@@ -613,7 +613,7 @@ QgsAbstractGeometry *QgsGeometryCollection::segmentize( double tolerance, Segmen

double QgsGeometryCollection::vertexAngle( QgsVertexId vertex ) const
{
if ( vertex.part >= mGeometries.size() )
if ( vertex.part < 0 || vertex.part >= mGeometries.size() )
{
return 0.0;
}

0 comments on commit 0e908d5

Please sign in to comment.
You can’t perform that action at this time.