From 07b0021ce3f92bdca3821381c026751a17d6565e Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Fri, 29 Jun 2018 18:00:15 -0700 Subject: Add fuzz tests for TileCover and fix out of bounds access crash. --- src/mbgl/util/tile_cover_impl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mbgl/util/tile_cover_impl.cpp b/src/mbgl/util/tile_cover_impl.cpp index f796cc7bd3..799ff2666a 100644 --- a/src/mbgl/util/tile_cover_impl.cpp +++ b/src/mbgl/util/tile_cover_impl.cpp @@ -32,6 +32,8 @@ void start_list_on_local_minimum(PointList& points) { next_pt++; if (next_pt == points.end()) { next_pt = std::next(points.begin()); } } + if (pt == points.end()) + return; //Re-close linear rings with first_pt = last_pt if (points.back() == points.front()) { points.pop_back(); -- cgit v1.2.1