Skip to content
Permalink
Browse files

Fix crash when trying to delete invalid curve from compound curves

  • Loading branch information
nyalldawson committed Sep 21, 2017
1 parent 840a9c1 commit cee1f5615909485dbf6dda532c58f484e92c43ab
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/geometry/qgscompoundcurve.cpp
@@ -417,13 +417,12 @@ void QgsCompoundCurve::addCurve( QgsCurve *c )

void QgsCompoundCurve::removeCurve( int i )
{
if ( mCurves.size() - 1 < i )
if ( i < 0 || i >= mCurves.size() )
{
return;
}

delete ( mCurves.at( i ) );
mCurves.removeAt( i );
delete mCurves.takeAt( i );
clearCache();
}

0 comments on commit cee1f56

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