Skip to content

Commit 33ba9a8

Browse files
committedSep 25, 2017
Fix crash when trying to insert geometry into collection with bad index
1 parent 6d59d14 commit 33ba9a8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/core/geometry/qgsgeometrycollection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ bool QgsGeometryCollection::insertGeometry( QgsAbstractGeometry *g, int index )
128128
return false;
129129
}
130130

131+
index = std::min( mGeometries.count(), index );
132+
131133
mGeometries.insert( index, g );
132134
clearCache(); //set bounding box invalid
133135
return true;

0 commit comments

Comments
 (0)
Please sign in to comment.