SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
24
devel/sdl-mixer/patches/patch-mixer_c
Normal file
24
devel/sdl-mixer/patches/patch-mixer_c
Normal file
|
@ -0,0 +1,24 @@
|
|||
Fix crash on double free if loading WAV file failed.
|
||||
|
||||
--- mixer.c.orig Fri Jun 1 02:35:52 2012
|
||||
+++ mixer.c Fri Jun 1 02:37:01 2012
|
||||
@@ -610,13 +610,15 @@ Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
|
||||
break;
|
||||
default:
|
||||
SDL_SetError("Unrecognized sound file type");
|
||||
- return(0);
|
||||
+ if ( freesrc ) {
|
||||
+ SDL_RWclose(src);
|
||||
+ }
|
||||
+ loaded = NULL;
|
||||
+ break;
|
||||
}
|
||||
if ( !loaded ) {
|
||||
+ /* The individual loaders have closed src if needed */
|
||||
SDL_free(chunk);
|
||||
- if ( freesrc ) {
|
||||
- SDL_RWclose(src);
|
||||
- }
|
||||
return(NULL);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue