Skip to content

Audio safety fixes #789

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 2 commits into from
Oct 9, 2018
Merged

Audio safety fixes #789

merged 2 commits into from
Oct 9, 2018

Conversation

Thinkofname
Copy link
Contributor

I had an assert in get_callback and noticed when it failed the program segfaulted, this was due to the userdata here Thinkofname@0ca6469#diff-93048819a6101989491fb36a4efc59cbL639 being freed with uninitialized memory. This seemed like the safest way to fix it but there could be a better way.

The AudioStatus change is just something I saw when reading through, the use of transmute seemed a bit funny there and could introduce undefined behaviour in safe code.

Transmuting from a value not in the enum is undefined, plus transmuting
is generally not great to do.
@Cobrand Cobrand merged commit 2b533d9 into Rust-SDL2:master Oct 9, 2018
sypwex pushed a commit to sypwex/rust-sdl2 that referenced this pull request Jun 2, 2024
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