From 3d16cd088ffe8f0a07f6d4f1dd38ac2082cd3f38 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 24 Jun 2016 11:25:08 -0700 Subject: [PATCH] [core] Protect against invalid geometries --- src/mbgl/annotation/shape_annotation_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp index c9d13e648..a61611cf1 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()); }