Skip to content

Commit

Permalink
Merge pull request #866 from awulkiew/fix/rtree_serialization
Browse files Browse the repository at this point in the history
Fix rtree serialization load for 1-level tree with number of elements lesser than min.
  • Loading branch information
awulkiew authored Jun 18, 2021
2 parents 14aa054 + d1be561 commit 6cc847b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/boost/geometry/index/detail/serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ class load
size_t elements_count;
ar >> boost::serialization::make_nvp("s", elements_count);

if ( elements_count < parameters.get_min_elements() || parameters.get_max_elements() < elements_count )
// leafs_level == 0 implies current_level == 0
if ( (elements_count < parameters.get_min_elements() && leafs_level > 0)
|| parameters.get_max_elements() < elements_count )
BOOST_THROW_EXCEPTION(std::runtime_error("rtree loading error"));

if ( current_level < leafs_level )
Expand Down

0 comments on commit 6cc847b

Please sign in to comment.