Skip to content

Fix segfault in poisson disk downsampling of empty point cloud#116

Open
SAY-5 wants to merge 1 commit into
fwilliams:masterfrom
SAY-5:fix-poisson-disk-empty-input
Open

Fix segfault in poisson disk downsampling of empty point cloud#116
SAY-5 wants to merge 1 commit into
fwilliams:masterfrom
SAY-5:fix-poisson-disk-empty-input

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 17, 2026

Copy link
Copy Markdown

Fixes #115.

downsample_point_cloud_poisson_disk crashes when the input point cloud has zero points. The radius path calls blue_noise_downsample, which computes grid bounds with X.colwise().minCoeff() and Xs.maxCoeff(); both are undefined on a zero-row Eigen matrix, so the empty case reads out of bounds and segfaults.

This returns an empty index array immediately when the input has no points, before the bounds are computed. Added a regression test for the empty-input case.

@fwilliams

Copy link
Copy Markdown
Owner

Thanks so much for the fix! I'll approve once CI goes green

@SAY-5

SAY-5 commented Jul 20, 2026

Copy link
Copy Markdown
Author

The ubuntu-22.04 wheel job failed while building the scipy build-dependency from source (metadata generation for scipy under cibuildwheel), which is unrelated to the two files changed here. A re-run should pick it up once the manylinux image resolves a buildable scipy; happy to rebase onto main if you'd prefer to retrigger that way.

@fwilliams

Copy link
Copy Markdown
Owner

Yes, could you rebase onto main? Thanks a lot!

@SAY-5
SAY-5 force-pushed the fix-poisson-disk-empty-input branch from a12554d to 01a5645 Compare July 22, 2026 18:48
@SAY-5

SAY-5 commented Jul 22, 2026

Copy link
Copy Markdown
Author

Rebased onto the latest master, so CI should pick up a fresh manylinux image now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault with empty point clouds

2 participants