[Boost-bugs] [Boost C++ Libraries] #11680: boost::polygon::connectivity_extraction<int>::extract crashes when no polygons were inserted

Subject: [Boost-bugs] [Boost C++ Libraries] #11680: boost::polygon::connectivity_extraction<int>::extract crashes when no polygons were inserted
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-24 08:56:52


#11680: boost::polygon::connectivity_extraction<int>::extract crashes when no
polygons were inserted
------------------------------+----------------------
 Reporter: mhilferink@… | Owner: ljsimons
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: polygon
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------
 steps to reproduce:

 {{{#!C++
 #include <boost/polygon/polygon.hpp>
 int main() {
   boost::polygon::connectivity_extraction<int> ce;
   std::vector<std::set<int> > graph;
   ce.extract(graph); // causes access violation
 }
 }}}
 The debugger indicates an access violation in

 {{{#!C++
     template <typename iT>
     static inline void compute_histogram_in_y(iT begin, iT end,
 std::size_t size, std::vector<std::pair<Unit, std::pair<std::size_t,
 std::size_t> > >& histogram);

 }}}

 Apparently, the original coder assumed (incorrectly?) that the given size
 != 0.

 a simple 'if' would probably resolve this I do in my client code as well.
 I just wonder what the best level would be to introduce this if:
 - connectivity_extraction::extract
 - arbitrary_connectivity_extraction::execute
 - or better in boost::polygon::line_intersection<T>::validate_scan ?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11680>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC