summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-24 11:25:08 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-24 12:21:44 -0700
commit3d16cd088ffe8f0a07f6d4f1dd38ac2082cd3f38 (patch)
tree226f0f9414bcc1bbb3df2ad853ac7759b1cf770c /src
parent3ccda590992df15a4b37ffe1fd1a1ef3254f9635 (diff)
downloadqtlocation-mapboxgl-3d16cd088ffe8f0a07f6d4f1dd38ac2082cd3f38.tar.gz
[core] Protect against invalid geometries
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/annotation/shape_annotation_impl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp
index c9d13e6486..a61611cf18 100644
--- a/src/mbgl/annotation/shape_annotation_impl.cpp
+++ b/src/mbgl/annotation/shape_annotation_impl.cpp
@@ -73,7 +73,8 @@ private:
converted.push_back(convertPoint(p));
}
- if (type == geojsonvt::ProjectedFeatureType::Polygon && points.front() != points.back()) {
+ assert(points.size() > 0);
+ if (type == geojsonvt::ProjectedFeatureType::Polygon && points.size() > 0 && points.front() != points.back()) {
converted.push_back(converted.front());
}