Skip to content

Commit

Permalink
Fix potential crash when calling QgsCircularString::pointN with bad
Browse files Browse the repository at this point in the history
index
  • Loading branch information
nyalldawson committed Sep 19, 2017
1 parent e937782 commit afcb82e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/geometry/qgscircularstring.cpp
Expand Up @@ -389,7 +389,7 @@ int QgsCircularString::numPoints() const

QgsPoint QgsCircularString::pointN( int i ) const
{
if ( std::min( mX.size(), mY.size() ) <= i )
if ( i < 0 || std::min( mX.size(), mY.size() ) <= i )
{
return QgsPoint();
}
Expand Down

0 comments on commit afcb82e

Please sign in to comment.