public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in media-libs/libmikmod/files/3.2.0: 003_all_multilib.patch 007_all_loopingvolume-fix.patch 004_all_malloc-fail.patch 005_all_CVE-2007-6720.patch 001_all_64bit.patch 006_all_CVE-2009-0179.patch 002_all_strip-lib.patch 008_all_ldflags.patch
@ 2012-11-17 17:53 Samuli Suominen (ssuominen)
  0 siblings, 0 replies; only message in thread
From: Samuli Suominen (ssuominen) @ 2012-11-17 17:53 UTC (permalink / raw
  To: gentoo-commits

ssuominen    12/11/17 17:53:17

  Added:                003_all_multilib.patch
                        007_all_loopingvolume-fix.patch
                        004_all_malloc-fail.patch
                        005_all_CVE-2007-6720.patch 001_all_64bit.patch
                        006_all_CVE-2009-0179.patch 002_all_strip-lib.patch
                        008_all_ldflags.patch
  Log:
  Version bump.
  
  (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)

Revision  Changes    Path
1.1                  media-libs/libmikmod/files/3.2.0/003_all_multilib.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/003_all_multilib.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/003_all_multilib.patch?rev=1.1&content-type=text/plain

Index: 003_all_multilib.patch
===================================================================
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



1.1                  media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/007_all_loopingvolume-fix.patch?rev=1.1&content-type=text/plain

Index: 007_all_loopingvolume-fix.patch
===================================================================
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);
 }
 



1.1                  media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/004_all_malloc-fail.patch?rev=1.1&content-type=text/plain

Index: 004_all_malloc-fail.patch
===================================================================
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);



1.1                  media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/005_all_CVE-2007-6720.patch?rev=1.1&content-type=text/plain

Index: 005_all_CVE-2007-6720.patch
===================================================================
--- 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;



1.1                  media-libs/libmikmod/files/3.2.0/001_all_64bit.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/001_all_64bit.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/001_all_64bit.patch?rev=1.1&content-type=text/plain

Index: 001_all_64bit.patch
===================================================================
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__)



1.1                  media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/006_all_CVE-2009-0179.patch?rev=1.1&content-type=text/plain

Index: 006_all_CVE-2009-0179.patch
===================================================================
--- 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;



1.1                  media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/002_all_strip-lib.patch?rev=1.1&content-type=text/plain

Index: 002_all_strip-lib.patch
===================================================================
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)



1.1                  media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libmikmod/files/3.2.0/008_all_ldflags.patch?rev=1.1&content-type=text/plain

Index: 008_all_ldflags.patch
===================================================================
* 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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-17 17:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-17 17:53 [gentoo-commits] gentoo-x86 commit in media-libs/libmikmod/files/3.2.0: 003_all_multilib.patch 007_all_loopingvolume-fix.patch 004_all_malloc-fail.patch 005_all_CVE-2007-6720.patch 001_all_64bit.patch 006_all_CVE-2009-0179.patch 002_all_strip-lib.patch 008_all_ldflags.patch Samuli Suominen (ssuominen)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox