-
Notifications
You must be signed in to change notification settings - Fork 565
Open
Description
Steps to reproduce
- Run ICP in a debug build with a VarTrimmedDistOutlierFilter for any reasonable data.
Expected results
ICP should run without any C++ standard library assertions being violated.
Actual results
MSVC C++ runtime stops with error: "cannot seek vector iterator after end". This is due to the following incorrect code in OutlierFiltersImpl.cpp:
std::vector<T> tmpCumSumSortedDist;
tmpCumSumSortedDist.reserve(points_nbr);
std::partial_sum(tmpSortedDist.begin(), tmpSortedDist.end(), tmpCumSumSortedDist.begin());Discussion
std::partial_sum() requires the vector being written to have the elements already created. The line above calling reserve() allocates memory in the vector (which is how an access violation is probably avoided), but does not change the size of the vector, which is still 0.
Replacing reserve(points_nbr) with resize(tmpSortedDist.size()) will fix this step, but points_nbr (the wrong size) is also used in the lines following this one.
Notes
This is currently found on both master and the latest release (1.4.4).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels