From 0fba03f8167844d545e234272ab8525e6159b700 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 19 Sep 2017 13:45:03 +1000 Subject: [PATCH] Fix potential crash in QgsCircularString::vertexAngle --- src/core/geometry/qgscircularstring.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/geometry/qgscircularstring.cpp b/src/core/geometry/qgscircularstring.cpp index 0b23e024fdb1..8397910ac049 100644 --- a/src/core/geometry/qgscircularstring.cpp +++ b/src/core/geometry/qgscircularstring.cpp @@ -893,6 +893,12 @@ void QgsCircularString::insertVertexBetween( int after, int before, int pointOnC double QgsCircularString::vertexAngle( QgsVertexId vId ) const { + if ( numPoints() < 3 ) + { + //undefined + return 0.0; + } + int before = vId.vertex - 1; int vertex = vId.vertex; int after = vId.vertex + 1;