summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/libmikmod/files/3.2.0')
-rw-r--r--media-libs/libmikmod/files/3.2.0/001_all_64bit.patch26
-rw-r--r--media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch13
-rw-r--r--media-libs/libmikmod/files/3.2.0/003_all_multilib.patch35
-rw-r--r--media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch22
-rw-r--r--media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch109
-rw-r--r--media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch12
-rw-r--r--media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch21
-rw-r--r--media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch15
-rw-r--r--media-libs/libmikmod/files/3.2.0/009_all_shell.patch17
-rw-r--r--media-libs/libmikmod/files/3.2.0/010_all_altivec.patch13
10 files changed, 283 insertions, 0 deletions
diff --git a/media-libs/libmikmod/files/3.2.0/001_all_64bit.patch b/media-libs/libmikmod/files/3.2.0/001_all_64bit.patch
new file mode 100644
index 000000000000..5aa45566c30c
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/001_all_64bit.patch
@@ -0,0 +1,26 @@
+http://pkgs.fedoraproject.org/cgit/libmikmod.git/tree/libmikmod-64bit.patch
+
+--- include/mikmod.h.in
++++ include/mikmod.h.in
+@@ -85,7 +85,8 @@ typedef char CHAR;
+
+ @DOES_NOT_HAVE_SIGNED@
+
+-#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__)
++#include <stdint.h>
++#if __WORDSIZE == 64
+ /* 64 bit architectures */
+
+ typedef signed char SBYTE; /* 1 byte, signed */
+--- include/mikmod_internals.h
++++ include/mikmod_internals.h
+@@ -43,7 +43,8 @@ extern "C" {
+ /*========== More type definitions */
+
+ /* SLONGLONG: 64bit, signed */
+-#if defined (__arch64__) || defined(__alpha) || defined (__x64_64) || defined (_LP64) || defined (__powerpc64__)
++#include <stdint.h>
++#if __WORDSIZE == 64
+ typedef long SLONGLONG;
+ #define NATIVE_64BIT_INT
+ #elif defined(__WATCOMC__)
diff --git a/media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch b/media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch
new file mode 100644
index 000000000000..beef6129f7af
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch
@@ -0,0 +1,13 @@
+http://pkgs.fedoraproject.org/cgit/libmikmod.git/tree/libmikmod-strip-lib.patch
+
+--- libmikmod/Makefile.in
++++ libmikmod/Makefile.in
+@@ -51,7 +51,7 @@
+
+ install: $(LIB)
+ $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
+- $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(LIB) $(DESTDIR)$(libdir)
++ $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(LIB) $(DESTDIR)$(libdir)
+
+ uninstall: $(LIB)
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIB)
diff --git a/media-libs/libmikmod/files/3.2.0/003_all_multilib.patch b/media-libs/libmikmod/files/3.2.0/003_all_multilib.patch
new file mode 100644
index 000000000000..be2483857fd4
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/003_all_multilib.patch
@@ -0,0 +1,35 @@
+http://pkgs.fedoraproject.org/cgit/libmikmod.git/tree/libmikmod-multilib.patch
+
+--- libmikmod-config.in
++++ libmikmod-config.in
+@@ -5,7 +5,7 @@
+ exec_prefix_set=no
+
+ usage="\
+-Usage: libmikmod-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] [--ldadd]"
++Usage: libmikmod-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--libs32] [--libs64] [--cflags] [--ldadd]"
+
+ if test $# -eq 0 ; then
+ echo "${usage}" 1>&2
+@@ -49,9 +49,21 @@
+ echo @LIB_LDADD@
+ ;;
+ --libs)
++ if [ -d /usr/lib64 ]; then
++ libdir=-L${exec_prefix}/lib64
++ else
++ libdir=-L${exec_prefix}/lib
++ fi
++ echo $libdir -lmikmod @LIBRARY_LIB@
++ ;;
++ --libs32)
+ libdir=-L${exec_prefix}/lib
+ echo $libdir -lmikmod @LIBRARY_LIB@
+ ;;
++ --libs64)
++ libdir=-L${exec_prefix}/lib64
++ echo $libdir -lmikmod @LIBRARY_LIB@
++ ;;
+ *)
+ echo "${usage}" 1>&2
+ exit 1
diff --git a/media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch b/media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch
new file mode 100644
index 000000000000..9214df87d72e
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch
@@ -0,0 +1,22 @@
+http://pkgs.fedoraproject.org/cgit/libmikmod.git/tree/libmikmod-malloc-fail.patch
+
+Some partially corrupt mod files cause mikmod to try and allocate lots
+of memory, this is ok, because failure to do so is being handled.
+
+But the new libmikmod malloc code align_pointer function did not handle
+asking to align the NULL pointer, resulting from the too big alloc,
+causing a segfault, this patch fixes this.
+
+--- mmio/mmalloc.c
++++ mmio/mmalloc.c
+@@ -38,6 +38,10 @@ static void * align_pointer(char *ptr, s
+ {
+ char *pptr = ptr + sizeof(void*);
+ char *fptr;
++
++ if (ptr == NULL)
++ return NULL;
++
+ size_t err = ((size_t)pptr)&(stride-1);
+ if (err)
+ fptr = pptr + (stride - err);
diff --git a/media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch b/media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch
new file mode 100644
index 000000000000..a49c50a56da6
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch
@@ -0,0 +1,109 @@
+--- playercode/mplayer.c
++++ playercode/mplayer.c
+@@ -50,6 +50,8 @@ extern long int random(void);
+ /* The currently playing module */
+ MODULE *pf = NULL;
+
++#define NUMVOICES(mod) (md_sngchn < (mod)->numvoices ? md_sngchn : (mod)->numvoices)
++
+ #define HIGH_OCTAVE 2 /* number of above-range octaves */
+
+ static UWORD oldperiods[OCTAVE*2]={
+@@ -246,14 +248,14 @@ static int MP_FindEmptyChannel(MODULE *m
+ MP_VOICE *a;
+ ULONG t,k,tvol,pp;
+
+- for (t=0;t<md_sngchn;t++)
++ for (t=0;t<NUMVOICES(mod);t++)
+ if (((mod->voice[t].main.kick==KICK_ABSENT)||
+ (mod->voice[t].main.kick==KICK_ENV))&&
+ Voice_Stopped_internal(t))
+ return t;
+
+ tvol=0xffffffUL;t=-1;a=mod->voice;
+- for (k=0;k<md_sngchn;k++,a++) {
++ for (k=0;k<NUMVOICES(mod);k++,a++) {
+ /* allow us to take over a nonexisting sample */
+ if (!a->main.s)
+ return k;
+@@ -2247,12 +2249,12 @@ static void DoNNAEffects(MODULE *mod, MP
+
+ switch (dat) {
+ case 0x0: /* past note cut */
+- for (t=0;t<md_sngchn;t++)
++ for (t=0;t<NUMVOICES(mod);t++)
+ if (mod->voice[t].master==a)
+ mod->voice[t].main.fadevol=0;
+ break;
+ case 0x1: /* past note off */
+- for (t=0;t<md_sngchn;t++)
++ for (t=0;t<NUMVOICES(mod);t++)
+ if (mod->voice[t].master==a) {
+ mod->voice[t].main.keyoff|=KEY_OFF;
+ if ((!(mod->voice[t].venv.flg & EF_ON))||
+@@ -2261,7 +2263,7 @@ static void DoNNAEffects(MODULE *mod, MP
+ }
+ break;
+ case 0x2: /* past note fade */
+- for (t=0;t<md_sngchn;t++)
++ for (t=0;t<NUMVOICES(mod);t++)
+ if (mod->voice[t].master==a)
+ mod->voice[t].main.keyoff|=KEY_FADE;
+ break;
+@@ -2316,7 +2318,7 @@ void pt_UpdateVoices(MODULE *mod, int ma
+ SAMPLE *s;
+
+ mod->totalchn=mod->realchn=0;
+- for (channel=0;channel<pf->numchn;channel++) {
++ for (channel=0;channel<NUMVOICES(mod);channel++) {
+ aout=&mod->voice[channel];
+ i=aout->main.i;
+ s=aout->main.s;
+@@ -2737,7 +2739,7 @@ void pt_NNA(MODULE *mod)
+ if (a->dct!=DCT_OFF) {
+ int t;
+
+- for (t=0;t<md_sngchn;t++)
++ for (t=0;t<NUMVOICES(mod);t++)
+ if ((!Voice_Stopped_internal(t))&&
+ (mod->voice[t].masterchn==channel)&&
+ (a->main.sample==mod->voice[t].main.sample)) {
+@@ -2979,6 +2981,11 @@ BOOL Player_Init(MODULE* mod)
+ if (!(mod->voice=(MP_VOICE*)MikMod_calloc(md_sngchn,sizeof(MP_VOICE))))
+ return 1;
+
++ /* mod->numvoices was used during loading to clamp md_sngchn.
++ After loading it's used to remember how big mod->voice is.
++ */
++ mod->numvoices = md_sngchn;
++
+ Player_Init_internal(mod);
+ return 0;
+ }
+@@ -3087,7 +3094,7 @@ MIKMODAPI void Player_NextPosition(void)
+ pf->patbrk=0;
+ pf->vbtick=pf->sngspd;
+
+- for (t=0;t<pf->numchn;t++) {
++ for (t=0;t<NUMVOICES(pf);t++) {
+ Voice_Stop_internal(t);
+ pf->voice[t].main.i=NULL;
+ pf->voice[t].main.s=NULL;
+@@ -3112,7 +3119,7 @@ MIKMODAPI void Player_PrevPosition(void)
+ pf->patbrk=0;
+ pf->vbtick=pf->sngspd;
+
+- for (t=0;t<pf->numchn;t++) {
++ for (t=0;t<NUMVOICES(pf);t++) {
+ Voice_Stop_internal(t);
+ pf->voice[t].main.i=NULL;
+ pf->voice[t].main.s=NULL;
+@@ -3139,7 +3146,7 @@ MIKMODAPI void Player_SetPosition(UWORD
+ pf->sngpos=pos;
+ pf->vbtick=pf->sngspd;
+
+- for (t=0;t<pf->numchn;t++) {
++ for (t=0;t<NUMVOICES(pf);t++) {
+ Voice_Stop_internal(t);
+ pf->voice[t].main.i=NULL;
+ pf->voice[t].main.s=NULL;
diff --git a/media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch b/media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch
new file mode 100644
index 000000000000..f70c35e0bfe8
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch
@@ -0,0 +1,12 @@
+--- loaders/load_xm.c
++++ loaders/load_xm.c
+@@ -611,7 +611,8 @@ static BOOL LoadInstruments(void)
+ nextwav[of.numsmp+u]=next;
+ next+=s->length;
+
+- if(_mm_eof(modreader)) {
++ /* last instrument is at the end of file in version 0x0104 */
++ if(_mm_eof(modreader) && (mh->version<0x0104 || t<of.numins-1)) {
+ MikMod_free(nextwav);MikMod_free(wh);
+ nextwav=NULL;wh=NULL;
+ _mm_errno = MMERR_LOADING_SAMPLEINFO;
diff --git a/media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch b/media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch
new file mode 100644
index 000000000000..a6ccdb8784d2
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch
@@ -0,0 +1,21 @@
+Yi-Huang Han (24 Oct 2001)
+ * Fixed MOD music volume when looping
+
+Samuli Suominen (17 Nov 2012)
+ * Refresh the patch against libmikmod 3.2.0 release since it didn't make it upstream
+ $ wget http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12.tar.gz
+ $ tar -vzxf SDL_mixer-1.2.12.tar.gz (or "tar xf" with GNU tar)
+ $ unzip libmikmod-3.1.12.zip
+ $ ls -l libmikmod-3.1.12-loopingvolume-fix.diff
+
+--- playercode/mplayer.c
++++ playercode/mplayer.c
+@@ -3013,7 +3013,7 @@
+ {
+ MUTEX_LOCK(vars);
+ if (pf)
+- pf->volume=(volume<0)?0:(volume>128)?128:volume;
++ pf->volume=pf->initvolume=(volume<0)?0:(volume>128)?128:volume;
+ MUTEX_UNLOCK(vars);
+ }
+
diff --git a/media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch b/media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch
new file mode 100644
index 000000000000..e85ca13ea6ec
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch
@@ -0,0 +1,15 @@
+* Samuli Suominen (17 Nov 2012)
+ Reviewed libmikmod-3.2.0_beta2-autotools.patch from gentoo-x86 and only this
+ chunk didn't make it upstream
+
+--- libmikmod/Makefile.in
++++ libmikmod/Makefile.in
+@@ -73,7 +73,7 @@
+ rm -f Makefile
+
+ $(LIB): $(OBJ)
+- $(LIBTOOL) --mode=link $(CC) -version-info 3:0:0 -o $@ $(OBJ) $(LIBRARY_LIB) -rpath $(DESTDIR)$(libdir)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info 3:0:0 -o $@ $(OBJ) $(LIBRARY_LIB) -rpath $(DESTDIR)$(libdir)
+
+ dl_hpux.lo: $(top_srcdir)/dlapi/dl_hpux.c \
+ $(top_srcdir)/dlapi/dlfcn.h
diff --git a/media-libs/libmikmod/files/3.2.0/009_all_shell.patch b/media-libs/libmikmod/files/3.2.0/009_all_shell.patch
new file mode 100644
index 000000000000..af4a2f6e0261
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/009_all_shell.patch
@@ -0,0 +1,17 @@
+Upstream didn't ship Makefile.am so we have to patch bits by hands.
+$(SHELL) is needed to run libtool properly (contains bashisms).
+LIBTOOL variable uses $(SHELL) in it's definition.
+
+Gentoo-bug: http://bugs.gentoo.org/401329
+Reported by: Anthony Parsons
+
+--- libmikmod/Makefile.in
++++ libmikmod/Makefile.in
+@@ -27,6 +27,7 @@ CC=@CC@
+ INSTALL=@INSTALL@
+ LIBTOOL=@LIBTOOL@
+ MKINSTALLDIRS=${top_srcdir}/mkinstalldirs
++SHELL=@SHELL@
+
+ DEFS=@DEFS@
+ CFLAGS=@CFLAGS@ -Dunix
diff --git a/media-libs/libmikmod/files/3.2.0/010_all_altivec.patch b/media-libs/libmikmod/files/3.2.0/010_all_altivec.patch
new file mode 100644
index 000000000000..5159634c0fc7
--- /dev/null
+++ b/media-libs/libmikmod/files/3.2.0/010_all_altivec.patch
@@ -0,0 +1,13 @@
+http://bugs.gentoo.org/show_bug.cgi?id=445556#c2
+
+--- configure.in
++++ configure.in
+@@ -724,7 +724,7 @@
+ ;;
+ Linux)
+ dnl force_cpusubtype_ALL not allowed for Linux as
+- CFLAGS="$CFLAGS -faltivec"
++ CFLAGS="$CFLAGS -maltivec"
+ ;;
+ esac
+ fi