mirror of https://github.com/CGAL/cgal
Fixed missing bound check in the sequential insertion phase
If the input point set is degenerate, dimension() < 3 is always 'true' and we will eventually try to read beyond the end of the points vector. See issue https://github.com/CGAL/cgal/issues/2922
This commit is contained in:
parent
29747165f7
commit
b080804f09
|
|
@ -381,7 +381,7 @@ public:
|
|||
// Insert "num_points_seq" points sequentially
|
||||
// (or more if dim < 3 after that)
|
||||
size_t num_points_seq = (std::min)(num_points, (size_t)100);
|
||||
while (dimension() < 3 || i < num_points_seq)
|
||||
while (i < num_points_seq || (dimension() < 3 && i < num_points))
|
||||
{
|
||||
hint = insert(points[i], hint);
|
||||
++i;
|
||||
|
|
@ -464,7 +464,7 @@ private:
|
|||
// Insert "num_points_seq" points sequentially
|
||||
// (or more if dim < 3 after that)
|
||||
size_t num_points_seq = (std::min)(num_points, (size_t)100);
|
||||
while (dimension() < 3 || i < num_points_seq)
|
||||
while (i < num_points_seq || (dimension() < 3 && i < num_points))
|
||||
{
|
||||
hint = insert(points[indices[i]], hint);
|
||||
if (hint != Vertex_handle()) hint->info() = infos[indices[i]];
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ namespace CGAL {
|
|||
// Insert "num_points_seq" points sequentially
|
||||
// (or more if dim < 3 after that)
|
||||
size_t num_points_seq = (std::min)(num_points, (size_t)100);
|
||||
while (dimension() < 3 || i < num_points_seq)
|
||||
while (i < num_points_seq || (dimension() < 3 && i < num_points))
|
||||
{
|
||||
Locate_type lt;
|
||||
Cell_handle c;
|
||||
|
|
@ -483,7 +483,7 @@ namespace CGAL {
|
|||
// Insert "num_points_seq" points sequentially
|
||||
// (or more if dim < 3 after that)
|
||||
size_t num_points_seq = (std::min)(num_points, (size_t)100);
|
||||
while (dimension() < 3 || i < num_points_seq)
|
||||
while (i < num_points_seq || (dimension() < 3 && i < num_points))
|
||||
{
|
||||
Locate_type lt;
|
||||
Cell_handle c;
|
||||
|
|
|
|||
Loading…
Reference in New Issue