[Pkg-sdl-commits] [sdl-mixer1.2] 01/01: Modify bug-715461-soundfont_paths.patch again to delete memory allocated dynamically
Manuel A. Fernandez Montecelo
mafm at alioth.debian.org
Wed Oct 9 18:46:41 UTC 2013
This is an automated email from the git hooks/post-receive script.
mafm pushed a commit to branch master
in repository sdl-mixer1.2.
commit 396542188f997d14a066d8ddcb4007ca72667509
Author: Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
Date: Wed Oct 9 19:28:18 2013 +0100
Modify bug-715461-soundfont_paths.patch again to delete memory allocated dynamically
Modify bug-715461-soundfont_paths.patch again to delete memory allocated
dynamically, otherwise it leaks memory when Mix_Init() is called repeatedly
(not the normal way in which the library is used, but it happens for example
with test cases in libsdl-perl, see #718129 and #715461). Thanks Fabian
Greffrath for keeping track of this and suggesting the new fix.
---
debian/changelog | 10 ++++++++++
debian/patches/bug-715461-soundfont_paths.patch | 15 +++++++++------
debian/rules | 2 ++
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 8ec9806..f88f3e8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+sdl-mixer1.2 (1.2.12-9) unstable; urgency=low
+
+ * Modify bug-715461-soundfont_paths.patch again to delete memory allocated
+ dynamically, otherwise it leaks memory when Mix_Init() is called repeatedly
+ (not the normal way in which the library is used, but it happens for example
+ with test cases in libsdl-perl, see #718129 and #715461). Thanks Fabian
+ Greffrath for keeping track of this and suggesting the new fix.
+
+ -- Manuel A. Fernandez Montecelo <mafm at debian.org> Wed, 09 Oct 2013 19:22:03 +0100
+
sdl-mixer1.2 (1.2.12-8) unstable; urgency=low
* Modify bug-715461-soundfont_paths.patch to add a string as dynamic memory,
diff --git a/debian/patches/bug-715461-soundfont_paths.patch b/debian/patches/bug-715461-soundfont_paths.patch
index bf2fe63..c871aab 100644
--- a/debian/patches/bug-715461-soundfont_paths.patch
+++ b/debian/patches/bug-715461-soundfont_paths.patch
@@ -1,15 +1,18 @@
Description: no sf2 sound fonts loaded by default
Introduced in 1.2.12-6 (Thu, 11 Jul 2013 12:17:15 +0100)
Author: Fabian Greffrath <fabian at greffrath.com>
-Last-Update: 2013-08-11
+Last-Update: 2013-10-09
Bug-Debian: http://bugs.debian.org/715461
--- a/mixer.c
+++ b/mixer.c
-@@ -148,6 +148,8 @@
+@@ -148,6 +148,11 @@
{
int result = 0;
-+ soundfont_paths = SDL_strdup("/usr/share/sounds/sf2/TimGM6mb.sf2:/usr/share/sounds/sf2/FluidR3_GM.sf2");
++#ifdef MIX_INIT_SOUNDFONT_PATHS
++ if (!soundfont_paths)
++ soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS);
++#endif
+
if (flags & MIX_INIT_FLUIDSYNTH) {
#ifdef USE_FLUIDSYNTH_MIDI
@@ -20,7 +23,7 @@ Bug-Debian: http://bugs.debian.org/715461
{
char *context, *path, *paths;
const char* cpaths = Mix_GetSoundFonts();
-+ int atleastone = 0;
++ int soundfonts_found = 0;
if (!cpaths) {
Mix_SetError("No SoundFonts have been requested");
@@ -32,13 +35,13 @@ Bug-Debian: http://bugs.debian.org/715461
- return 0;
+ continue;
+ } else {
-+ atleastone++;
++ soundfonts_found++;
}
}
SDL_free(paths);
- return 1;
-+ if (atleastone > 0)
++ if (soundfonts_found > 0)
+ return 1;
+ else
+ return 0;
diff --git a/debian/rules b/debian/rules
index aed70ed..5437680 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,6 +3,8 @@
#export DH_VERBOSE=1
export DEB_CFLAGS_MAINT_APPEND = -pipe -Wall
+# bug #715461, provide default soundfont paths
+export DEB_CPPFLAGS_MAINT_APPEND = -DMIX_INIT_SOUNDFONT_PATHS=\"/usr/share/sounds/sf2/TimGM6mb.sf2:/usr/share/sounds/sf2/FluidR3_GM.sf2\"
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined -Wl,-Bsymbolic -Wl,--as-needed
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sdl/packages/sdl-mixer1.2.git
More information about the pkg-sdl-commits
mailing list