Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix crash when trying to delete invalid curve from compound curves
  • Loading branch information
nyalldawson committed Sep 21, 2017
1 parent 840a9c1 commit cee1f56
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/geometry/qgscompoundcurve.cpp
Expand Up @@ -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();
}

Expand Down

0 comments on commit cee1f56

Please sign in to comment.