Fix crash with a single support point

This commit is contained in:
tamasmeszaros 2022-05-17 16:28:13 +02:00
parent d23f9d7674
commit f90d62c771

View file

@ -498,7 +498,8 @@ std::vector<size_t> non_duplicate_suppt_indices(const PtIndex &index,
!to_remove[i_closest];
});
if ((suppts[i].pos - suppts[closest_idx].pos).norm() < eps)
if (closest_idx < suppts.size() &&
(suppts[i].pos - suppts[closest_idx].pos).norm() < eps)
to_remove[i] = true;
}