diff --git a/libmikmod-3.1.12-CVE-2007-6720.diff b/CVE-2007-6720.diff similarity index 50% rename from libmikmod-3.1.12-CVE-2007-6720.diff rename to CVE-2007-6720.diff index 15b2dfe..2c99ed5 100644 --- a/libmikmod-3.1.12-CVE-2007-6720.diff +++ b/CVE-2007-6720.diff @@ -1,19 +1,17 @@ -This patch fixes "buffer overflow due to md_numchn - ID: 1630158" - -Index: libmikmod-3.1.12/playercode/mplayer.c +Index: libmikmod-3.2.0/playercode/mplayer.c =================================================================== ---- libmikmod-3.1.12.orig/playercode/mplayer.c -+++ libmikmod-3.1.12/playercode/mplayer.c -@@ -52,6 +52,8 @@ extern long int random(void); - will wait */ - /*static*/ MODULE *pf = NULL; +--- libmikmod-3.2.0.orig/playercode/mplayer.c ++++ libmikmod-3.2.0/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]={ -@@ -248,14 +250,14 @@ static int MP_FindEmptyChannel(MODULE *m +@@ -246,14 +248,14 @@ static int MP_FindEmptyChannel(MODULE *m MP_VOICE *a; ULONG t,k,tvol,pp; @@ -30,7 +28,7 @@ Index: libmikmod-3.1.12/playercode/mplayer.c /* allow us to take over a nonexisting sample */ if (!a->main.s) return k; -@@ -2249,12 +2251,12 @@ static void DoNNAEffects(MODULE *mod, MP +@@ -2247,12 +2249,12 @@ static void DoNNAEffects(MODULE *mod, MP switch (dat) { case 0x0: /* past note cut */ @@ -45,7 +43,7 @@ Index: libmikmod-3.1.12/playercode/mplayer.c if (mod->voice[t].master==a) { mod->voice[t].main.keyoff|=KEY_OFF; if ((!(mod->voice[t].venv.flg & EF_ON))|| -@@ -2263,7 +2265,7 @@ static void DoNNAEffects(MODULE *mod, MP +@@ -2261,7 +2263,7 @@ static void DoNNAEffects(MODULE *mod, MP } break; case 0x2: /* past note fade */ @@ -54,16 +52,7 @@ Index: libmikmod-3.1.12/playercode/mplayer.c if (mod->voice[t].master==a) mod->voice[t].main.keyoff|=KEY_FADE; break; -@@ -2318,7 +2320,7 @@ void pt_UpdateVoices(MODULE *mod, int ma - SAMPLE *s; - - mod->totalchn=mod->realchn=0; -- for (channel=0;channelvoice[channel]; - i=aout->main.i; - s=aout->main.s; -@@ -2736,7 +2738,7 @@ void pt_NNA(MODULE *mod) +@@ -2737,7 +2739,7 @@ void pt_NNA(MODULE *mod) if (a->dct!=DCT_OFF) { int t; @@ -72,8 +61,8 @@ Index: libmikmod-3.1.12/playercode/mplayer.c if ((!Voice_Stopped_internal(t))&& (mod->voice[t].masterchn==channel)&& (a->main.sample==mod->voice[t].main.sample)) { -@@ -2978,6 +2980,11 @@ BOOL Player_Init(MODULE* mod) - if (!(mod->voice=(MP_VOICE*)_mm_calloc(md_sngchn,sizeof(MP_VOICE)))) +@@ -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. @@ -84,30 +73,12 @@ Index: libmikmod-3.1.12/playercode/mplayer.c Player_Init_internal(mod); return 0; } -@@ -3086,7 +3093,7 @@ MIKMODAPI void Player_NextPosition(void) - pf->patbrk=0; - pf->vbtick=pf->sngspd; +@@ -3370,7 +3377,7 @@ MIKMODAPI int Player_QueryVoices(UWORD n -- for (t=0;tvoice[t].main.i=NULL; - pf->voice[t].main.s=NULL; -@@ -3111,7 +3118,7 @@ MIKMODAPI void Player_PrevPosition(void) - pf->patbrk=0; - pf->vbtick=pf->sngspd; - -- for (t=0;tvoice[t].main.i=NULL; - pf->voice[t].main.s=NULL; -@@ -3138,7 +3145,7 @@ MIKMODAPI void Player_SetPosition(UWORD - pf->sngpos=pos; - pf->vbtick=pf->sngspd; - -- for (t=0;tvoice[t].main.i=NULL; - pf->voice[t].main.s=NULL; + MUTEX_LOCK(vars); + if (pf) +- for (i = 0; i < md_sngchn; i++) { ++ for (i = 0; i < numvoices; i++) { + vinfo [i].i = pf->voice[i].main.i; + vinfo [i].s = pf->voice[i].main.s; + vinfo [i].panning = pf->voice [i].main.panning; diff --git a/baselibs.conf b/baselibs.conf index 38d1af7..9fb5056 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1 +1 @@ -libmikmod2 +libmikmod3 diff --git a/libmikmod-3.1.12-64bit-fix.diff b/libmikmod-3.1.12-64bit-fix.diff deleted file mode 100644 index e9291c0..0000000 --- a/libmikmod-3.1.12-64bit-fix.diff +++ /dev/null @@ -1,49 +0,0 @@ -Date: Sun, 04 Jul 2004 11:53:23 +0200 -From: Josselin Mouette -Subject: Re: sdl 64bit problem [PATCH] - -Le sam, 03/07/2004 � 18:20 +0200, Hans-Frieder Vogt a �crit : -> Hi list, -> -> I found the problem that lead to the distorted sound in tuxracer on AMD64. It -> may have also been the cause for the other reported sound problems with SDL. -> The problem is not in SDL, but in SDL-mixer. -> There, music files (*.it, and probably others as well) are incorrectly read on -> all 64 bit architectures but Alpha, due to an incorrect data type definition. -> The attached patch should solve the problem for all 64 bit architectures on -> Linux, since at least cpp defines _LP64 and __LP64__ for them. -> _LP64 indicates that long ints and pointers are 64 bits, but integers are 32 -> bits. -> I am not sure whether the usage of _LP64 is also standard for the commercial -> compilers, and for other Unixes, but at least Solaris 9 defines _LP64 in the -> 64 bit environment as well. -> -> Josselin, -> could you include this patch into your next debian packages? - -Index: libmikmod-3.1.12/include/mikmod.h.in -=================================================================== ---- libmikmod-3.1.12.orig/include/mikmod.h.in -+++ libmikmod-3.1.12/include/mikmod.h.in -@@ -85,7 +85,7 @@ typedef char CHAR; - - @DOES_NOT_HAVE_SIGNED@ - --#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) -+#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(_LP64) - /* 64 bit architectures */ - - typedef signed char SBYTE; /* 1 byte, signed */ -Index: libmikmod-3.1.12/include/mikmod_internals.h -=================================================================== ---- libmikmod-3.1.12.orig/include/mikmod_internals.h -+++ libmikmod-3.1.12/include/mikmod_internals.h -@@ -50,7 +50,7 @@ extern "C" { - /*========== More type definitions */ - - /* SLONGLONG: 64bit, signed */ --#if defined (__arch64__) || defined(__alpha) -+#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(_LP64) - typedef long SLONGLONG; - #define NATIVE_64BIT_INT - #elif defined(__WATCOMC__) diff --git a/libmikmod-3.1.12-CVE-2009-0179.diff b/libmikmod-3.1.12-CVE-2009-0179.diff deleted file mode 100644 index 368a42f..0000000 --- a/libmikmod-3.1.12-CVE-2009-0179.diff +++ /dev/null @@ -1,35 +0,0 @@ -Index: loaders/load_xm.c -=================================================================== ---- loaders/load_xm.c.orig -+++ loaders/load_xm.c -@@ -636,7 +636,8 @@ static BOOL LoadInstruments(void) - _mm_fseek(modreader,ck,SEEK_SET); - for(u=headend-_mm_ftell(modreader);u;u--) _mm_read_UBYTE(modreader); - -- if(_mm_eof(modreader)) { -+ /* last instrument is at the end of file in version 0x0104 */ -+ if(_mm_eof(modreader) && (mh->version<0x0104 || tInit || l->Init()) { - _mm_rewind(modreader); - ok = l->Load(curious); -- /* propagate inflags=flags for in-module samples */ -- for (t = 0; t < of.numsmp; t++) -- if (of.samples[t].inflags == 0) -- of.samples[t].inflags = of.samples[t].flags; -+ if (ok) { -+ /* propagate inflags=flags for in-module samples */ -+ for (t = 0; t < of.numsmp; t++) -+ if (of.samples[t].inflags == 0) -+ of.samples[t].inflags = of.samples[t].flags; -+ } - } else - ok = 0; - diff --git a/libmikmod-3.1.12-CVE-2009-3995,3996.diff b/libmikmod-3.1.12-CVE-2009-3995,3996.diff deleted file mode 100644 index 932896e..0000000 --- a/libmikmod-3.1.12-CVE-2009-3995,3996.diff +++ /dev/null @@ -1,37 +0,0 @@ -Index: loaders/load_it.c -=================================================================== ---- loaders/load_it.c.orig -+++ loaders/load_it.c -@@ -747,6 +747,8 @@ BOOL IT_Load(BOOL curious) - ih. name##end =_mm_read_UBYTE(modreader); \ - ih. name##susbeg=_mm_read_UBYTE(modreader); \ - ih. name##susend=_mm_read_UBYTE(modreader); \ -+ if (ih. name##pts>= ITENVCNT) \ -+ ih. name##pts = ITENVCNT-1; \ - for(lp=0;lp= ITENVCNT) \ -+ ih. name/**/pts = ITENVCNT-1; \ - for(lp=0;lp=UF_MAXCHAN) -+ of.numchn=UF_MAXCHAN - 1; -+ - /* read pan position table for v1.5 and higher */ - if(mh.id[14]>='3') { - for(t=0;t&2 diff --git a/libmikmod-3.1.12-conftest_fix.diff b/libmikmod-3.1.12-conftest_fix.diff deleted file mode 100644 index 2622d77..0000000 --- a/libmikmod-3.1.12-conftest_fix.diff +++ /dev/null @@ -1,30 +0,0 @@ -Index: libmikmod.m4 -=================================================================== ---- libmikmod.m4.orig -+++ libmikmod.m4 -@@ -64,6 +64,7 @@ dnl - #include - #include - #include -+#include - - char* my_strdup (char *str) - { -@@ -78,7 +79,7 @@ char* my_strdup (char *str) - return new_str; - } - --int main() -+int main(void) - { - int major,minor,micro; - int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; -@@ -118,7 +119,7 @@ int main() - (libmikmod_micro_version != LIBMIKMOD_REVISION)) - { - printf("*** libmikmod header files (version %d.%d.%d) do not match\n", -- LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); -+ (int)LIBMIKMOD_VERSION_MAJOR, (int)LIBMIKMOD_VERSION_MINOR, (int)LIBMIKMOD_REVISION); - printf("*** library (version %d.%d.%d)\n", - libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); - } diff --git a/libmikmod-3.1.12-exitcrash-fix.diff b/libmikmod-3.1.12-exitcrash-fix.diff deleted file mode 100644 index ede3988..0000000 --- a/libmikmod-3.1.12-exitcrash-fix.diff +++ /dev/null @@ -1,22 +0,0 @@ -Date: 15 Apr 2002 11:01:19 +0200 -From: Guillaume Cottenceau - -Unfortunately, I should have double checked that the following -fix (authored by Dave Goehrig , not me), -was really in the CVS... it's not, as of stable 1.2.3 at least. -Please include it, it fixes a segfault on exiting a program which -disabled MOD music during its execution. - -Index: libmikmod-3.1.12/playercode/virtch_common.c -=================================================================== ---- libmikmod-3.1.12.orig/playercode/virtch_common.c -+++ libmikmod-3.1.12/playercode/virtch_common.c -@@ -347,7 +347,7 @@ void VC1_VoiceSetPanning(UBYTE voice,ULO - - void VC1_SampleUnload(SWORD handle) - { -- if (handleCmdLineHelp string. + + libmikmod-3.1.11-CVE-2010-2546,2971.diff + + libmikmod-3.1.11-CVE-2009-3995,3996.diff + + Now checking for linking against -lm. + + Modified patch of libmikmod-CVE-2009-0179.patch. + + Apply the libmikmod-CVE-2007-6720.patch. + + Implement a fix for sprintf-of-list + + Apply a patch for non-blocking opening of the OSS driver. + + Fixed the prototypes of vc_callback. + + Cast a vc_callback parameter to "unsigned char *" instead of "char *", + becuase the former is what it accepts. + + Check for Samples' validatity in virtch_common.c. + + Fix compilation on MSVC. +- Drop all patches, fixed upstream. +- Stop passing autoreconf, not needed anymore since we do not carry + any patches. +- Bump so name, following upstream changes. + ------------------------------------------------------------------- Fri Sep 7 13:18:34 UTC 2012 - coolo@suse.com diff --git a/libmikmod.spec b/libmikmod.spec index 15ab562..47f2df2 100644 --- a/libmikmod.spec +++ b/libmikmod.spec @@ -1,7 +1,7 @@ # # spec file for package libmikmod # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libmikmod -%define lname libmikmod2 +%define lname libmikmod3 BuildRequires: esound-devel BuildRequires: libtool %if 0%{suse_version} > 1220 @@ -27,20 +27,14 @@ Url: http://mikmod.raphnet.net/ Summary: MikMod Sound Library License: LGPL-2.1+ Group: Development/Libraries/C and C++ -Version: 3.1.12 +Version: 3.2.0 Release: 0 -Source: %{name}-%{version}.tar.bz2 +Source: http://mikmod.shlomifish.org/files/%{name}-%{version}.tar.gz Source1: %{name}-rpmlintrc Source2: baselibs.conf -Patch0: %{name}-3.1.12-CVE-2007-6720.diff -Patch1: %{name}-3.1.12-CVE-2009-0179.diff -Patch2: %{name}-3.1.12-64bit-fix.diff -Patch3: %{name}-3.1.12-autotools.diff -Patch4: %{name}-3.1.12-config-fix.diff -Patch5: %{name}-3.1.12-conftest_fix.diff -Patch6: %{name}-3.1.12-exitcrash-fix.diff -Patch7: %{name}-3.1.12-loopingvolume-fix.diff -Patch8: %{name}-3.1.12-CVE-2009-3995,3996.diff +Patch0: libmikmod-lp64.patch +Patch1: CVE-2007-6720.diff +Patch2: libmikmod-3.2.0-loopingvolume-fix.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -97,17 +91,10 @@ mtm, xm, and it. %prep %setup -q %patch0 -p1 -%patch1 +%patch1 -p1 %patch2 -p1 -%patch3 -%patch4 -%patch5 -%patch6 -p1 -%patch7 -p1 -%patch8 %build -autoreconf -f -i %configure --disable-static --with-pic make %{?_smp_mflags} @@ -130,7 +117,7 @@ ln -f $RPM_BUILD_ROOT%{_includedir}/mikmod{,_build}.h %files -n %lname %defattr(-,root,root) %doc COPYING.LIB COPYING.LESSER -%{_libdir}/libmikmod.so.2* +%{_libdir}/libmikmod.so.3* %files devel %defattr(-,root,root)