Skip to content

Commit

Permalink
Fix segfault (infinite recursion) of PointCloud::DetectPlanarPatches …
Browse files Browse the repository at this point in the history
…if multiple points have same coordinates (#6794)
  • Loading branch information
nicolaloi committed May 17, 2024
1 parent a1fb32c commit 1b55f11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- Fix log error message for `probability` argument validation in `PointCloud::SegmentPlane` (PR #6622)
- Fix macOS arm64 builds, add CI runner for macOS arm64 (PR #6695)
- Fix KDTreeFlann possibly using a dangling pointer instead of internal storage and simplified its members (PR #6734)
- Fix segmentation fault (infinite recursion) of DetectPlanarPatches if multiple points have same coordinates (PR #6794)

## 0.13

Expand Down
19 changes: 13 additions & 6 deletions cpp/open3d/geometry/PointCloudPlanarPatchDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <Eigen/Dense>
#include <algorithm>
#include <cstdint>
#include <limits>
#include <numeric>
#include <queue>
#include <unordered_map>
Expand Down Expand Up @@ -57,12 +58,18 @@ class BoundaryVolumeHierarchy {

/// \brief Constructor for the root node of the octree.
///
/// \param point_cloud is the associated set of points being partitioned
BoundaryVolumeHierarchy(const PointCloud* point_cloud,
const Eigen::Vector3d& min_bound,
const Eigen::Vector3d& max_bound,
size_t min_points = 1,
double min_size = 0.0)
/// \param point_cloud is the associated set of points being partitioned.
/// \param min_bound is the minimum coordinate of the bounding volume.
/// \param max_bound is the maximum coordinate of the bounding volume.
/// \param min_points is the threshold number of points in a node to stop
/// partitioning it further. \param min_size is the threshold size of a node
/// to stop partitioning it further.
BoundaryVolumeHierarchy(
const PointCloud* point_cloud,
const Eigen::Vector3d& min_bound,
const Eigen::Vector3d& max_bound,
size_t min_points = 1,
double min_size = std::numeric_limits<double>::epsilon())
: point_cloud_(point_cloud),
min_points_(min_points),
min_size_(min_size),
Expand Down

0 comments on commit 1b55f11

Please sign in to comment.