Fix a Coverity warning in SDL Sound #3000
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
First commit fixes the assert macro. The downside of how we're copy + pasting third party libraries into our tree is that we're not using the build system it was written for.
HAVE_ASSERT_H
is something SDL's build system would have defined. I just removed that macro and always do a#include assert.h
since we rely on that header in our other code regardless.Second commit adds an assert that hopefully Coverity is smart enough to follow. It thinks there is a use after free bug if we're removing from the middle of the linked list in
Sound_Quit
but that never happens. It's freeing the entire list always removing from the head.Related issues
#2996
Manual testing
Tested with ripped .ogg files of the Quake sound track. Added the assert and confirmed it does not trigger on quit.
Checklist
Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.
I have: