Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes mourner/delaunator-rs#8 - panics index out of bounds #13

Merged
merged 1 commit into from
Jan 9, 2021

Conversation

andreesteve
Copy link
Collaborator

I believe this fixes #8
I was able to narrow a repro with the following smaller set of points:

fn main() {
    let s = vec![
        Point { x: -0.2, y: -0.26 },
        Point { x: -0.5, y: -0.57 },
        Point { x: -0.06, y: 0.4 },
        Point { x: 0.0, y: 0.47 },
        Point { x: 0.6, y: 0.0 },
        Point { x: -0.9, y: -0.8 },
    ];

    triangulate(&s);
}

Which now passes. This error was happening on my 10M random point benchmark, which now passes consistently with this patch.

I haven't yet got a chance to validate the correctness of the generated triangulation. I'll do that next, but wanted to get the PR out for early review.

Comparing with the javascript implementation this seems to match the implementation there, so it gives me some hope this is the right fix.

Copy link
Owner

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much! Yeah, I haven't brought over all the fixes from the JS version yet — this port was more of a learning project for me than something I needed for work.

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.

Crash: index out of bounds: the len is 14 but the index is 18446744073709551615
2 participants