We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2004 - Calling Mix_Quit twice with midi support leads to segfault
Summary: Calling Mix_Quit twice with midi support leads to segfault
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-01 04:10 UTC by Martin Gerhardy
Modified: 2013-08-01 04:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Gerhardy 2013-08-01 04:10:24 UTC
the variable soundfont_paths is freed, but not set to NULL. So calling Mix_Quit a second time would crash if SDL_mixer is compiled with midi support. For all the other sound types, it's guarded with if (initialized). So i think it would be good to fix this by setting the soundfont_paths variable to NULL in line 231 of mixer.c


diff -r d4f0ea99a069 mixer.c
--- a/mixer.c	Wed Jul 31 21:45:53 2013 -0700
+++ b/mixer.c	Thu Aug 01 10:08:43 2013 +0200
@@ -243,6 +243,7 @@
 #ifdef MID_MUSIC
     if (soundfont_paths) {
         SDL_free(soundfont_paths);
+        soundfont_paths = NULL;
     }
 #endif
     initialized = 0;
Comment 1 Sam Lantinga 2013-08-01 04:39:09 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL_mixer/rev/bbc63f965931