Skip to content

Avoid NaN generation in compute_angular_offsets#613

Merged
solidpixel merged 2 commits intomainfrom
issue_580
May 7, 2026
Merged

Avoid NaN generation in compute_angular_offsets#613
solidpixel merged 2 commits intomainfrom
issue_580

Conversation

@solidpixel
Copy link
Copy Markdown
Contributor

@solidpixel solidpixel commented May 7, 2026

If both inputs to atan2() are zero, it produces a NaN. This can propagate into later calculations and results in trying to convert a NaN into an int, which is UB. the PR suppresses NaNs in compute_angular_offsets(), replacing them with zeros.

Fixes #580.

@solidpixel solidpixel merged commit 103ba94 into main May 7, 2026
9 checks passed
@solidpixel solidpixel deleted the issue_580 branch May 7, 2026 12:54
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.

UBSAN failure due to NaN generation in compute_angular_offsets

1 participant