diff --git a/SDL_mixer-c99.patch b/SDL_mixer-c99.patch new file mode 100644 index 0000000..f01a41e --- /dev/null +++ b/SDL_mixer-c99.patch @@ -0,0 +1,26 @@ +For declarations of Mix_QuitFluidSynth, Mix_InitFluidSynth. + +This code was removed upstream in: + +commit a65a84adb8a898a1479e026c3e3520b8ce95b728 +Author: Sam Lantinga +Date: Tue Oct 17 02:33:47 2017 -0700 + + Rewrote music.c to support any number of decode libraries using a compiled-in plugin interface + Mix_LoadWAV_RW() can now load sound formats that were previously available only as music. + + This is still work in progress. Testing and project updates need to happen on other platforms. + + +diff --git a/mixer.c b/mixer.c +index 2f28384474b9d4d1..f87d29a8bd3320bf 100644 +--- a/mixer.c ++++ b/mixer.c +@@ -35,6 +35,7 @@ + #include "load_ogg.h" + #include "load_flac.h" + #include "dynamic_flac.h" ++#include "dynamic_fluidsynth.h" + #include "dynamic_mod.h" + #include "dynamic_mp3.h" + #include "dynamic_ogg.h" diff --git a/SDL_mixer-fix-double-free.patch b/SDL_mixer-fix-double-free.patch new file mode 100644 index 0000000..515b1b5 --- /dev/null +++ b/SDL_mixer-fix-double-free.patch @@ -0,0 +1,33 @@ +From 23b6289224edb24fcb8266fce9647822b69c4298 Mon Sep 17 00:00:00 2001 +From: Sam Lantinga +Date: Sun, 12 Feb 2012 17:58:22 -0500 +Subject: [PATCH] Fixed 1418 - crash on double free if loading WAV file failed + +--- + mixer.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/mixer.c b/mixer.c +index 2f283844..ecb5da91 100644 +--- a/mixer.c ++++ b/mixer.c +@@ -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); + } + diff --git a/SDL_mixer.spec b/SDL_mixer.spec index 77aeda1..db9a79d 100644 --- a/SDL_mixer.spec +++ b/SDL_mixer.spec @@ -6,13 +6,16 @@ Summary: Simple DirectMedia Layer - mixer Name: SDL_mixer Version: 1.2.12 -Release: 11 +Release: 12 License: LGPLv2+ Group: System/Libraries Url: http://www.libsdl.org/projects/SDL_mixer/ Source0: http://www.libsdl.org/projects/SDL_mixer/release/%{name}-%{version}.tar.gz +# MikMod-related fixes from trunk Patch0: SDL_mixer-MikMod-1.patch Patch1: SDL_mixer-MikMod-2.patch +Patch2: SDL_mixer-c99.patch +Patch3: SDL_mixer-fix-double-free.patch BuildRequires: libstdc++-static-devel BuildRequires: pkgconfig(esound) BuildRequires: pkgconfig(flac) @@ -81,6 +84,8 @@ This package contains binary to test the associated library. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure \