Skip to content

[rtextures] Fix Undefined behaviour in ColorToInt #3996

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

Merged
merged 1 commit into from
May 21, 2024

Conversation

OetkenPurveyorOfCode
Copy link
Contributor

If the red value is too large, the right shift operator leads to overflow in the signed int. Closes issue #3987. The cast to int afterward is not UB, only implementation-defined behaviour. See #3987.

@raysan5 raysan5 merged commit 9ef29af into raysan5:master May 21, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented May 21, 2024

@OetkenPurveyorOfCode thanks for the review!

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.

2 participants