Skip to content

Commit

Permalink
Fix out of bounds array access if nextVertex is called on empty QgsGe…
Browse files Browse the repository at this point in the history
…ometryCollectionV2

(cherry-picked from 4c0e78a)
  • Loading branch information
manisandro authored and nyalldawson committed Mar 6, 2016
1 parent e2879c3 commit 1031172
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/geometry/qgsgeometrycollectionv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ bool QgsGeometryCollectionV2::nextVertex( QgsVertexId& id, QgsPointV2& vertex )
id.ring = -1;
id.vertex = -1;
}
if ( mGeometries.isEmpty() )
{
return false;
}

QgsAbstractGeometryV2* geom = mGeometries.at( id.part );
if ( geom->nextVertex( id, vertex ) )
Expand Down

0 comments on commit 1031172

Please sign in to comment.