[libmikmod] update to 3.2.0-beta3
Jindrich Novy
jnovy at fedoraproject.org
Tue Apr 10 11:52:59 UTC 2012
commit d88974b224d92054c26547f8241bf42b41152037
Author: Jindrich Novy <jnovy at redhat.com>
Date: Tue Apr 10 13:55:17 2012 +0200
update to 3.2.0-beta3
.gitignore | 2 +-
libmikmod-64bit.patch | 34 +++++++++--------
libmikmod-CVE-2007-6720.patch | 71 ++++++++++++++++++++++++------------
libmikmod-CVE-2009-0179.patch | 44 ++++++----------------
libmikmod-CVE-2009-3995,3996.patch | 66 ---------------------------------
libmikmod-autoconf.patch | 12 ------
libmikmod-esd.patch | 36 +++++++-----------
libmikmod-info.patch | 34 -----------------
libmikmod-multilib.patch | 11 ------
libmikmod.spec | 20 +++++------
sources | 2 +-
11 files changed, 103 insertions(+), 229 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3ac1d61..019d837 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-libmikmod-3.2.0-beta2.tar.bz2
+/libmikmod-3.2.0b3.tar.gz
diff --git a/libmikmod-64bit.patch b/libmikmod-64bit.patch
index 309b680..0da8952 100644
--- a/libmikmod-64bit.patch
+++ b/libmikmod-64bit.patch
@@ -1,24 +1,26 @@
---- libmikmod-3.1.11/include/mikmod_internals.h.64bit 2004-08-04 05:08:06.604109384 +0200
-+++ libmikmod-3.1.11/include/mikmod_internals.h 2004-08-04 05:09:56.700372208 +0200
-@@ -50,7 +50,8 @@
- /*========== More type definitions */
-
- /* SLONGLONG: 64bit, signed */
--#if defined (__arch64__) || defined(__alpha)
-+#include <stdint.h>
-+#if __WORDSIZE == 64
- typedef long SLONGLONG;
- #define NATIVE_64BIT_INT
- #elif defined(__WATCOMC__)
---- libmikmod-3.1.11/include/mikmod.h.in.64bit 2004-08-04 05:07:56.092707360 +0200
-+++ libmikmod-3.1.11/include/mikmod.h.in 2004-08-04 05:09:06.217046840 +0200
-@@ -85,7 +85,8 @@
+diff -up libmikmod-3.2.0b3/include/mikmod.h.in.64bit libmikmod-3.2.0b3/include/mikmod.h.in
+--- libmikmod-3.2.0b3/include/mikmod.h.in.64bit 2012-03-14 18:02:59.000000000 +0100
++++ libmikmod-3.2.0b3/include/mikmod.h.in 2012-04-10 06:11:45.973323955 +0200
+@@ -85,7 +85,8 @@ typedef char CHAR;
@DOES_NOT_HAVE_SIGNED@
--#if defined(__arch64__) || defined(__alpha)
+-#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 */
+diff -up libmikmod-3.2.0b3/include/mikmod_internals.h.64bit libmikmod-3.2.0b3/include/mikmod_internals.h
+--- libmikmod-3.2.0b3/include/mikmod_internals.h.64bit 2012-03-14 18:02:59.000000000 +0100
++++ libmikmod-3.2.0b3/include/mikmod_internals.h 2012-04-10 06:10:18.667415429 +0200
+@@ -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/libmikmod-CVE-2007-6720.patch b/libmikmod-CVE-2007-6720.patch
index 45cc355..d9984b2 100644
--- a/libmikmod-CVE-2007-6720.patch
+++ b/libmikmod-CVE-2007-6720.patch
@@ -1,18 +1,16 @@
-This patch fixes "buffer overflow due to md_numchn - ID: 1630158"
-
-diff -ru libmikmod-3.1.12.orig/playercode/mplayer.c libmikmod-3.1.12/playercode/mplayer.c
---- libmikmod-3.1.12.orig/playercode/mplayer.c 2007-12-15 01:26:28.000000000 -0800
-+++ libmikmod-3.1.12/playercode/mplayer.c 2009-10-04 23:48:36.000000000 -0700
-@@ -52,6 +52,8 @@
- will wait */
- /*static*/ MODULE *pf = NULL;
+diff -up libmikmod-3.2.0b3/playercode/mplayer.c.CVE-2007-6720 libmikmod-3.2.0b3/playercode/mplayer.c
+--- libmikmod-3.2.0b3/playercode/mplayer.c.CVE-2007-6720 2012-03-14 20:21:57.000000000 +0100
++++ libmikmod-3.2.0b3/playercode/mplayer.c 2012-04-10 06:32:28.046795898 +0200
+@@ -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 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 @@
+@@ -246,14 +248,14 @@ static int MP_FindEmptyChannel(MODULE *m
MP_VOICE *a;
ULONG t,k,tvol,pp;
@@ -29,7 +27,7 @@ diff -ru libmikmod-3.1.12.orig/playercode/mplayer.c libmikmod-3.1.12/playercode/
/* allow us to take over a nonexisting sample */
if (!a->main.s)
return k;
-@@ -2249,12 +2251,12 @@
+@@ -2247,12 +2249,12 @@ static void DoNNAEffects(MODULE *mod, MP
switch (dat) {
case 0x0: /* past note cut */
@@ -44,7 +42,7 @@ diff -ru libmikmod-3.1.12.orig/playercode/mplayer.c libmikmod-3.1.12/playercode/
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 @@
+@@ -2261,7 +2263,7 @@ static void DoNNAEffects(MODULE *mod, MP
}
break;
case 0x2: /* past note fade */
@@ -53,16 +51,16 @@ diff -ru libmikmod-3.1.12.orig/playercode/mplayer.c libmikmod-3.1.12/playercode/
if (mod->voice[t].master==a)
mod->voice[t].main.keyoff|=KEY_FADE;
break;
-@@ -2318,7 +2320,7 @@
+@@ -2316,7 +2318,7 @@ void pt_UpdateVoices(MODULE *mod, int ma
SAMPLE *s;
mod->totalchn=mod->realchn=0;
-- for (channel=0;channel<md_sngchn;channel++) {
+- 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;
-@@ -2736,7 +2738,7 @@
+@@ -2737,7 +2739,7 @@ void pt_NNA(MODULE *mod)
if (a->dct!=DCT_OFF) {
int t;
@@ -71,8 +69,8 @@ diff -ru libmikmod-3.1.12.orig/playercode/mplayer.c libmikmod-3.1.12/playercode/
if ((!Voice_Stopped_internal(t))&&
(mod->voice[t].masterchn==channel)&&
(a->main.sample==mod->voice[t].main.sample)) {
-@@ -2978,6 +2980,11 @@
- 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.
@@ -83,30 +81,57 @@ diff -ru libmikmod-3.1.12.orig/playercode/mplayer.c libmikmod-3.1.12/playercode/
Player_Init_internal(mod);
return 0;
}
-@@ -3086,7 +3093,7 @@
+@@ -3044,7 +3051,7 @@ MIKMODAPI void Player_Start(MODULE *mod)
+ if (pf!=mod) {
+ /* new song is being started, so completely stop out the old one. */
+ if (pf) pf->forbid=1;
+- for (t=0;t<md_sngchn;t++) Voice_Stop_internal(t);
++ for (t=0;t<NUMVOICES(pf);t++) Voice_Stop_internal(t);
+ }
+ pf=mod;
+ MUTEX_UNLOCK(vars);
+@@ -3087,12 +3094,12 @@ MIKMODAPI void Player_NextPosition(void)
pf->patbrk=0;
pf->vbtick=pf->sngspd;
-- for (t=0;t<md_sngchn;t++) {
+- 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;
-@@ -3111,7 +3118,7 @@
+ }
+- for (t=0;t<pf->numchn;t++) {
++ for (t=0;t<NUMVOICES(pf);t++) {
+ pf->control[t].main.i=NULL;
+ pf->control[t].main.s=NULL;
+ }
+@@ -3112,12 +3119,12 @@ MIKMODAPI void Player_PrevPosition(void)
pf->patbrk=0;
pf->vbtick=pf->sngspd;
-- for (t=0;t<md_sngchn;t++) {
+- 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;
-@@ -3138,7 +3145,7 @@
+ }
+- for (t=0;t<pf->numchn;t++) {
++ for (t=0;t<NUMVOICES(pf);t++) {
+ pf->control[t].main.i=NULL;
+ pf->control[t].main.s=NULL;
+ }
+@@ -3139,12 +3146,12 @@ MIKMODAPI void Player_SetPosition(UWORD
pf->sngpos=pos;
pf->vbtick=pf->sngspd;
-- for (t=0;t<md_sngchn;t++) {
+- 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;
+ }
+- for (t=0;t<pf->numchn;t++) {
++ for (t=0;t<NUMVOICES(pf);t++) {
+ pf->control[t].main.i=NULL;
+ pf->control[t].main.s=NULL;
+ }
diff --git a/libmikmod-CVE-2009-0179.patch b/libmikmod-CVE-2009-0179.patch
index 0c47e65..366c288 100644
--- a/libmikmod-CVE-2009-0179.patch
+++ b/libmikmod-CVE-2009-0179.patch
@@ -1,33 +1,13 @@
-diff -ur libmikmod-3.1.11.orig/loaders/load_xm.c libmikmod-3.1.11/loaders/load_xm.c
---- libmikmod-3.1.11.orig/loaders/load_xm.c 2004-01-21 18:43:53.000000000 +0100
-+++ libmikmod-3.1.11/loaders/load_xm.c 2008-04-16 04:30:45.000000000 +0200
-@@ -622,7 +622,8 @@
- /* read the remainder of the header */
- 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 || t<of.numins-1)) {
- free(nextwav);free(wh);
- nextwav=NULL;wh=NULL;
- _mm_errno = MMERR_LOADING_SAMPLEINFO;
-diff -ur libmikmod-3.1.11.orig/playercode/mloader.c libmikmod-3.1.11/playercode/mloader.c
---- libmikmod-3.1.11.orig/playercode/mloader.c 2004-01-21 18:43:53.000000000 +0100
-+++ libmikmod-3.1.11/playercode/mloader.c 2008-04-16 04:30:45.000000000 +0200
-@@ -450,10 +450,12 @@
- if (!l->Init || 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 -up libmikmod-3.2.0b3/loaders/load_xm.c.CVE-2009-0179 libmikmod-3.2.0b3/loaders/load_xm.c
+--- libmikmod-3.2.0b3/loaders/load_xm.c.CVE-2009-0179 2012-03-14 20:31:53.000000000 +0100
++++ libmikmod-3.2.0b3/loaders/load_xm.c 2012-04-10 06:34:55.657950508 +0200
+@@ -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/libmikmod-esd.patch b/libmikmod-esd.patch
index 2479fef..bb8cbd8 100644
--- a/libmikmod-esd.patch
+++ b/libmikmod-esd.patch
@@ -1,6 +1,7 @@
---- libmikmod-3.2.0-beta2/drivers/drv_esd.c 2004-01-31 23:39:40.000000000 +0100
-+++ libmikmod-3.2.0-beta2.new/drivers/drv_esd.c 2008-02-18 12:09:07.000000000 +0100
-@@ -81,7 +81,6 @@
+diff -up libmikmod-3.2.0b3/drivers/drv_esd.c.esd libmikmod-3.2.0b3/drivers/drv_esd.c
+--- libmikmod-3.2.0b3/drivers/drv_esd.c.esd 2012-03-14 18:02:59.000000000 +0100
++++ libmikmod-3.2.0b3/drivers/drv_esd.c 2012-04-10 06:15:29.052535082 +0200
+@@ -81,7 +81,6 @@ static void* libesd=NULL;
static int sndfd=-1;
static esd_format_t format;
@@ -8,7 +9,7 @@
static CHAR *espeaker=NULL;
#ifdef MIKMOD_DYNAMIC
-@@ -100,7 +99,7 @@
+@@ -100,7 +99,7 @@ static BOOL ESD_Link(void)
if (libesd) return 0;
/* load libesd.so */
@@ -17,7 +18,7 @@
if (!libesd) return 1;
/* resolve function references */
-@@ -124,23 +123,88 @@
+@@ -124,23 +123,88 @@ static void ESD_Unlink(void)
}
#endif
@@ -118,7 +119,7 @@
}
static void ESD_CommandLine(CHAR *cmdline)
-@@ -193,13 +257,14 @@
+@@ -193,13 +257,14 @@ static BOOL ESD_Init_internal(void)
_mm_errno=MMERR_OPENING_AUDIO;
return 1;
}
@@ -127,24 +128,15 @@
_mm_errno=MMERR_OUT_OF_MEMORY;
return 1;
}
--
-- if (!(audiobuffer=(SBYTE*)_mm_malloc(ESD_BUF_SIZE*sizeof(char))))
+
+- if (!(audiobuffer=(SBYTE*)MikMod_malloc(ESD_BUF_SIZE*sizeof(char))))
- return 1;
-+
+ /* Initialize the audiobuffer */
+ audiobuffer_init();
return VC_Init();
}
-@@ -218,7 +283,6 @@
- static void ESD_Exit_internal(void)
- {
- VC_Exit();
-- _mm_free(audiobuffer);
- if (sndfd>=0) {
- esd_closestream(sndfd);
- sndfd=-1;
-@@ -234,19 +298,50 @@
+@@ -234,19 +299,50 @@ static void ESD_Exit(void)
#endif
}
@@ -203,7 +195,7 @@
} else {
/* an alarm would be better, but then the library user could not use
alarm(2) himself... */
-@@ -255,8 +350,11 @@
+@@ -255,8 +351,11 @@ static void ESD_Update_internal(int coun
/* Attempt to reconnect every 5 seconds */
if (!(SETENV))
if ((sndfd=esd_playstream(format,md_mixfreq,espeaker,"libmikmod"))>=0) {
@@ -217,7 +209,7 @@
}
}
}
-@@ -264,22 +362,24 @@
+@@ -264,22 +363,24 @@ static void ESD_Update_internal(int coun
static void ESD_Update(void)
{
@@ -245,7 +237,7 @@
/* since the default behaviour of SIGPIPE on most Unices is to kill the
program, we'll prefer handle EPIPE ourselves should the esd die - recent
esdlib use a do-nothing handler, which prevents us from receiving EPIPE,
-@@ -289,6 +389,7 @@
+@@ -289,6 +390,7 @@ static BOOL ESD_PlayStart(void)
/* silence buffers */
VC_SilenceBytes(audiobuffer,ESD_BUF_SIZE);
esd_writebuf(sndfd,audiobuffer,ESD_BUF_SIZE);
@@ -253,7 +245,7 @@
return VC_PlayStart();
}
-@@ -299,6 +400,7 @@
+@@ -299,6 +401,7 @@ static void ESD_PlayStop(void)
/* silence buffers */
VC_SilenceBytes(audiobuffer,ESD_BUF_SIZE);
esd_writebuf(sndfd,audiobuffer,ESD_BUF_SIZE);
diff --git a/libmikmod-multilib.patch b/libmikmod-multilib.patch
index fac4bdd..3c4f21b 100644
--- a/libmikmod-multilib.patch
+++ b/libmikmod-multilib.patch
@@ -31,14 +31,3 @@
*)
echo "${usage}" 1>&2
exit 1
---- libmikmod-3.1.11/configure.old 2004-01-21 18:43:52.000000000 +0100
-+++ libmikmod-3.1.11/configure 2006-05-31 17:37:10.000000000 +0200
-@@ -6390,7 +6390,7 @@
- cross_compiling=$ac_cv_prog_cc_cross
-
- ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
-- ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
-+ ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs | sed -r 's|-L[^ ]+||g'`
-
- esd_major_version=`$ESD_CONFIG $esd_args --version | \
- sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
diff --git a/libmikmod.spec b/libmikmod.spec
index 5a3f749..1ad0ff8 100644
--- a/libmikmod.spec
+++ b/libmikmod.spec
@@ -1,22 +1,19 @@
Summary: A MOD music file player library
Name: libmikmod
Version: 3.2.0
-Release: 13.beta2%{?dist}
+Release: 13.beta3%{?dist}
License: GPLv2 and LGPLv2+
Group: Applications/Multimedia
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: esound-devel
-URL: http://mikmod.raphnet.net/
-Source0: http://mikmod.raphnet.net/files/libmikmod-%{version}-beta2.tar.bz2
+URL: http://http://mikmod.shlomifish.org/
+Source0: http://mikmod.shlomifish.org/files/libmikmod-%{version}b3.tar.gz
Patch0: libmikmod-64bit.patch
Patch1: libmikmod-esd.patch
Patch2: libmikmod-strip-lib.patch
Patch3: libmikmod-multilib.patch
-Patch4: libmikmod-autoconf.patch
-Patch5: libmikmod-info.patch
Patch6: libmikmod-CVE-2007-6720.patch
Patch7: libmikmod-CVE-2009-0179.patch
-Patch8: libmikmod-CVE-2009-3995,3996.patch
%description
libmikmod is a library used by the mikmod MOD music file player for
@@ -37,19 +34,16 @@ This package includes the header files you will need to compile
applications for mikmod.
%prep
-%setup -q -n %{name}-%{version}-beta2
+%setup -q -n %{name}-%{version}b3
%patch0 -p1 -b .64bit
%patch1 -p1 -b .esd
%patch2 -p1 -b .strip-lib
%patch3 -p1 -b .multilib
-%patch4 -p1 -b .autoconf
-%patch5 -p1 -b .info
%patch6 -p1 -b .CVE-2007-6720
%patch7 -p1 -b .CVE-2009-0179
-%patch8 -p1 -b .CVE-2009-3995,3996
%build
-%configure
+%configure --enable-dl
make %{?_smp_flags}
%install
@@ -88,6 +82,10 @@ fi
%{_mandir}/man1/libmikmod-config*
%changelog
+* Tue Apr 10 2012 Jindrich Novy <jnovy at redhat.com> - 3.2.0-13.beta3
+- update to 3.2.0-beta3
+- drop upstreamed patches, forwardport the rest
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.2.0-13.beta2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/sources b/sources
index 58b0a86..d7f371a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5b05f3b1167eba7855b8e38bde2b8070 libmikmod-3.2.0-beta2.tar.bz2
+22aa49a1776e691a96f14ec8f5429e6d libmikmod-3.2.0b3.tar.gz
More information about the scm-commits
mailing list