Skip to content

Commit

Permalink
Merge pull request #53 from mapbox/duplicate-point-crash
Browse files Browse the repository at this point in the history
Check iterator for validity before dereferencing
  • Loading branch information
e-n-f authored Dec 14, 2016
2 parents 4ee6478 + 617573b commit eec53a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/mapbox/geometry/wagyu/build_edges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ bool build_edge_list(mapbox::geometry::linear_ring<T> const& path_geometry, edge
// Find next non repeated point going backwards from
// end for pt1
while (pt1 == pt2) {
pt1 = *(++itr_rev);
++itr_rev;
if (itr_rev == path_geometry.rend()) {
return false;
}
pt1 = *itr_rev;
}
++itr;
mapbox::geometry::point<value_type> pt3 = *itr;
Expand Down

0 comments on commit eec53a6

Please sign in to comment.