From 2d3bfc296c0ba1b4e189d36d2d4ff984a464114f Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Mon, 16 Feb 2015 18:12:06 +0100 Subject: [PATCH] [buffer] Add assertions checking segments indexes >= 0 in buffered_piece_collection. --- .../algorithms/detail/buffer/buffered_piece_collection.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index cc0ab2b1a..4fb18d3e6 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -807,6 +807,9 @@ struct buffered_piece_collection { pc.offsetted_count = pc.last_segment_index - pc.first_seg_id.segment_index; BOOST_ASSERT(pc.offsetted_count >= 0); + BOOST_ASSERT(pc.first_seg_id.multi_index >= 0); + BOOST_ASSERT(pc.first_seg_id.segment_index >= 0); + BOOST_ASSERT(pc.last_segment_index >= 0); pc.robust_ring.reserve(pc.offsetted_count + helper_points_size);