Update libmodplug to 0.8.8.4 - all the patches go away.

Bump minor.
Take MAINTAINER.
ok landry@
This commit is contained in:
bcallah 2013-10-11 17:28:17 +00:00
parent 15b3334f10
commit 9612b89375
12 changed files with 9 additions and 253 deletions

View File

@ -1,14 +1,15 @@
# $OpenBSD: Makefile,v 1.9 2013/03/21 08:45:12 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.10 2013/10/11 17:28:17 bcallah Exp $
COMMENT = library for decoding mod-like music formats
DISTNAME = libmodplug-0.8.8.2
REVISION = 1
DISTNAME = libmodplug-0.8.8.4
CATEGORIES = audio
HOMEPAGE = http://modplug-xmms.sourceforge.net/
SHARED_LIBS += modplug 0.0 # .1.0
MAINTAINER = Brian Callahan <bcallah@openbsd.org>
SHARED_LIBS += modplug 0.1 # .1.0
# Public domain
PERMIT_PACKAGE_CDROM = Yes
@ -17,7 +18,6 @@ MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=modplug-xmms/}
WANTLIB += m stdc++
NO_TEST = Yes
CONFIGURE_STYLE = gnu

View File

@ -1,5 +1,2 @@
MD5 (libmodplug-0.8.8.2.tar.gz) = 4fzqxMO8Juvpb2GbRtJv9w==
RMD160 (libmodplug-0.8.8.2.tar.gz) = XmwcthldCtvWsnAE9qv/QAEzr0g=
SHA1 (libmodplug-0.8.8.2.tar.gz) = QluwExlCQqxF029UdXTTiD7lJ3A=
SHA256 (libmodplug-0.8.8.2.tar.gz) = be33lxP3q3UljAl6h0nauRJ8gWkoWNq1KV7vUE6mFwU=
SIZE (libmodplug-0.8.8.2.tar.gz) = 517938
SHA256 (libmodplug-0.8.8.4.tar.gz) = XF7hPd2+0US+JiduXxAtoX/1scmS8xADiZgwgtoiZPc=
SIZE (libmodplug-0.8.8.4.tar.gz) = 546319

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-src_load_abc_cpp,v 1.1 2011/05/05 21:25:48 jasper Exp $
Prevent abc_remove_unnecessary_events() from removing the last track.
From upstream git: d7c36959757fc6c8e4d487be8a72383093d9d26f
--- src/load_abc.cpp.orig Fri Mar 25 23:02:07 2011
+++ src/load_abc.cpp Thu May 5 23:20:40 2011
@@ -1022,10 +1022,12 @@ static void abc_remove_unnecessary_events(ABCHANDLE *h
_mm_free(h->trackhandle,tp);
tp = ptp;
}
- else {
+ else if (tp->next) {
h->track = tp->next;
_mm_free(h->trackhandle,tp);
tp = h->track;
+ } else {
+ break;
}
}
ptp = tp; // remember previous track

View File

@ -1,28 +0,0 @@
$OpenBSD: patch-src_load_ams_cpp,v 1.1 2011/08/18 17:56:47 jasper Exp $
AMSv2 off by one problem (related to SA45131/C)
From upstream git: 16d7a78efe14d345a6c5b241f88422ad0ee483ea
Fix AMS and DSM too large by one - SA45131/C
From upstream git: 26243ab9fe1171f70053e9aec4b20e9f7de9e4ef
--- src/load_ams.cpp.orig Thu Aug 18 19:49:58 2011
+++ src/load_ams.cpp Thu Aug 18 19:52:09 2011
@@ -52,7 +52,7 @@ BOOL CSoundFile::ReadAMS(LPCBYTE lpStream, DWORD dwMem
if ((!lpStream) || (dwMemLength < 1024)) return FALSE;
if ((pfh->verhi != 0x01) || (strncmp(pfh->szHeader, "Extreme", 7))
- || (!pfh->patterns) || (!pfh->orders) || (!pfh->samples) || (pfh->samples > MAX_SAMPLES)
+ || (!pfh->patterns) || (!pfh->orders) || (!pfh->samples) || (pfh->samples >= MAX_SAMPLES)
|| (pfh->patterns > MAX_PATTERNS) || (pfh->orders > MAX_ORDERS))
{
return ReadAMS2(lpStream, dwMemLength);
@@ -321,7 +321,7 @@ BOOL CSoundFile::ReadAMS2(LPCBYTE lpStream, DWORD dwMe
dwMemPos = pfh->titlelen + 8;
psh = (AMS2SONGHEADER *)(lpStream + dwMemPos);
if (((psh->version & 0xFF00) != 0x0200) || (!psh->instruments)
- || (psh->instruments > MAX_INSTRUMENTS) || (!psh->patterns) || (!psh->orders)) return FALSE;
+ || (psh->instruments >= MAX_INSTRUMENTS) || (!psh->patterns) || (!psh->orders)) return FALSE;
dwMemPos += sizeof(AMS2SONGHEADER);
if (pfh->titlelen)
{

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_load_dsm_cpp,v 1.1 2011/08/18 17:56:47 jasper Exp $
Fix AMS and DSM too large by one - SA45131/C
From upstream git: 26243ab9fe1171f70053e9aec4b20e9f7de9e4ef
--- src/load_dsm.cpp.orig Thu Aug 18 19:49:21 2011
+++ src/load_dsm.cpp Thu Aug 18 19:49:47 2011
@@ -101,7 +101,7 @@ BOOL CSoundFile::ReadDSM(LPCBYTE lpStream, DWORD dwMem
if (m_nChannels < 4) m_nChannels = 4;
if (m_nChannels > 16) m_nChannels = 16;
m_nSamples = psong->numsmp;
- if (m_nSamples > MAX_SAMPLES) m_nSamples = MAX_SAMPLES;
+ if (m_nSamples >= MAX_SAMPLES) m_nSamples = MAX_SAMPLES - 1;
m_nDefaultSpeed = psong->speed;
m_nDefaultTempo = psong->bpm;
m_nDefaultGlobalVolume = psong->globalvol << 2;

View File

@ -1,57 +0,0 @@
$OpenBSD: patch-src_load_it_cpp,v 1.1 2011/05/05 21:25:48 jasper Exp $
Fixed various possible integer overflows in CSoundFile::ReadIT().
From upstream git: 89dd2ff3f4463a5c657767cee81fa62dff7f70eb
--- src/load_it.cpp.orig Sun May 10 05:05:27 2009
+++ src/load_it.cpp Thu May 5 23:19:10 2011
@@ -216,7 +216,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dw
}
if (m_nChannels < 4) m_nChannels = 4;
// Reading Song Message
- if ((pifh.special & 0x01) && (pifh.msglength) && (pifh.msgoffset + pifh.msglength < dwMemLength))
+ if ((pifh.special & 0x01) && (pifh.msglength) && (pifh.msglength <= dwMemLength) && (pifh.msgoffset < dwMemLength - pifh.msglength))
{
m_lpszSongComments = new char[pifh.msglength+1];
if (m_lpszSongComments)
@@ -325,11 +325,11 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dw
for (UINT patchk=0; patchk<npatterns; patchk++)
{
memset(chnmask, 0, sizeof(chnmask));
- if ((!patpos[patchk]) || ((DWORD)patpos[patchk] + 4 >= dwMemLength)) continue;
+ if ((!patpos[patchk]) || ((DWORD)patpos[patchk] >= dwMemLength - 4)) continue;
UINT len = bswapLE16(*((WORD *)(lpStream+patpos[patchk])));
UINT rows = bswapLE16(*((WORD *)(lpStream+patpos[patchk]+2)));
if ((rows < 4) || (rows > 256)) continue;
- if (patpos[patchk]+8+len > dwMemLength) continue;
+ if (8+len > dwMemLength || patpos[patchk] > dwMemLength - (8+len)) continue;
UINT i = 0;
const BYTE *p = lpStream+patpos[patchk]+8;
UINT nrow = 0;
@@ -383,7 +383,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dw
// Reading Samples
m_nSamples = pifh.smpnum;
if (m_nSamples >= MAX_SAMPLES) m_nSamples = MAX_SAMPLES-1;
- for (UINT nsmp=0; nsmp<pifh.smpnum; nsmp++) if ((smppos[nsmp]) && (smppos[nsmp] + sizeof(ITSAMPLESTRUCT) <= dwMemLength))
+ for (UINT nsmp=0; nsmp<pifh.smpnum; nsmp++) if ((smppos[nsmp]) && (smppos[nsmp] <= dwMemLength - sizeof(ITSAMPLESTRUCT)))
{
ITSAMPLESTRUCT pis = *(ITSAMPLESTRUCT *)(lpStream+smppos[nsmp]);
pis.id = bswapLE32(pis.id);
@@ -450,7 +450,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dw
// Reading Patterns
for (UINT npat=0; npat<npatterns; npat++)
{
- if ((!patpos[npat]) || ((DWORD)patpos[npat] + 4 >= dwMemLength))
+ if ((!patpos[npat]) || ((DWORD)patpos[npat] >= dwMemLength - 4))
{
PatternSize[npat] = 64;
Patterns[npat] = AllocatePattern(64, m_nChannels);
@@ -460,7 +460,7 @@ BOOL CSoundFile::ReadIT(const BYTE *lpStream, DWORD dw
UINT len = bswapLE16(*((WORD *)(lpStream+patpos[npat])));
UINT rows = bswapLE16(*((WORD *)(lpStream+patpos[npat]+2)));
if ((rows < 4) || (rows > 256)) continue;
- if (patpos[npat]+8+len > dwMemLength) continue;
+ if (8+len > dwMemLength || patpos[npat] > dwMemLength - (8+len)) continue;
PatternSize[npat] = rows;
if ((Patterns[npat] = AllocatePattern(rows, m_nChannels)) == NULL) continue;
memset(lastvalue, 0, sizeof(lastvalue));

View File

@ -1,34 +0,0 @@
$OpenBSD: patch-src_load_med_cpp,v 1.1 2011/05/05 21:25:48 jasper Exp $
Fixed various possible integer overflows in CSoundFile::ReadMed()
From upstream git: ce87da55599421e851a5b13492b753defba17349
--- src/load_med.cpp.orig Mon May 11 10:21:30 2009
+++ src/load_med.cpp Thu May 5 23:21:15 2011
@@ -664,7 +664,7 @@ BOOL CSoundFile::ReadMed(const BYTE *lpStream, DWORD d
const MMD2PLAYSEQ *pmps = (MMD2PLAYSEQ *)(lpStream + pseq);
if (!m_szNames[0][0]) memcpy(m_szNames[0], pmps->name, 31);
UINT n = bswapBE16(pmps->length);
- if (pseq+n <= dwMemLength)
+ if (n < (dwMemLength - (pseq + sizeof(*pmps)) + sizeof(pmps->seq)) / sizeof(pmps->seq[0]))
{
for (UINT i=0; i<n; i++)
{
@@ -745,7 +745,7 @@ BOOL CSoundFile::ReadMed(const BYTE *lpStream, DWORD d
DWORD trktagofs = bswapBE32(ptrktags[i]);
if (trktagofs)
{
- while (trktagofs+8 < dwMemLength)
+ while (trktagofs < dwMemLength - 8)
{
DWORD ntag = bswapBE32(*(DWORD *)(lpStream + trktagofs));
if (ntag == MMDTAG_END) break;
@@ -758,7 +758,7 @@ BOOL CSoundFile::ReadMed(const BYTE *lpStream, DWORD d
trktagofs += 8;
}
if (trknamelen > MAX_CHANNELNAME) trknamelen = MAX_CHANNELNAME;
- if ((trknameofs) && (trknameofs + trknamelen < dwMemLength))
+ if ((trknameofs) && (trknamelen < dwMemLength) && (trknameofs < dwMemLength - trknamelen))
{
lstrcpyn(ChnSettings[i].szName, (LPCSTR)(lpStream+trknameofs), MAX_CHANNELNAME);
ChnSettings[i].szName[MAX_CHANNELNAME-1] = '\0';

View File

@ -1,50 +0,0 @@
$OpenBSD: patch-src_load_s3m_cpp,v 1.3 2011/08/18 17:56:48 jasper Exp $
Fix S3M stack overflows SA45131/B
From upstream git: f4e5295658fff000379caa122e75c9200205fe20
Fixed a potential memory overread in CSoundFile::ReadS3M()
From upstream git: 537e9fd5b95cf6c448e9bd2ea2973e8b139bce00
--- src/load_s3m.cpp.orig Fri Mar 25 23:17:18 2011
+++ src/load_s3m.cpp Thu Aug 18 19:47:06 2011
@@ -187,11 +187,11 @@ BOOL CSoundFile::ReadS3M(const BYTE *lpStream, DWORD d
//---------------------------------------------------------------
{
UINT insnum,patnum,nins,npat;
- DWORD insfile[128];
+ DWORD insfile[MAX_SAMPLES];
WORD ptr[256];
BYTE s[1024];
DWORD dwMemPos;
- BYTE insflags[128], inspack[128];
+ BYTE insflags[MAX_SAMPLES], inspack[MAX_SAMPLES];
S3MFILEHEADER psfh = *(S3MFILEHEADER *)lpStream;
psfh.reserved1 = bswapLE16(psfh.reserved1);
@@ -315,7 +315,14 @@ BOOL CSoundFile::ReadS3M(const BYTE *lpStream, DWORD d
Ins[iSmp].nC4Speed = j;
insfile[iSmp] = ((DWORD)bswapLE16(*((LPWORD)(s+0x0E)))) << 4;
insfile[iSmp] += ((DWORD)(BYTE)s[0x0D]) << 20;
- if (insfile[iSmp] > dwMemLength) insfile[iSmp] &= 0xFFFF;
+ // offset is invalid - ignore this sample.
+ if (insfile[iSmp] > dwMemLength) insfile[iSmp] = 0;
+ else if (insfile[iSmp]) {
+ // ignore duplicate samples.
+ for (int z=iSmp-1; z>=0; z--)
+ if (insfile[iSmp] == insfile[z])
+ insfile[iSmp] = 0;
+ }
if ((Ins[iSmp].nLoopStart >= Ins[iSmp].nLoopEnd) || (Ins[iSmp].nLoopEnd - Ins[iSmp].nLoopStart < 8))
Ins[iSmp].nLoopStart = Ins[iSmp].nLoopEnd = 0;
Ins[iSmp].nPan = 0x80;
@@ -393,7 +400,8 @@ BOOL CSoundFile::ReadS3M(const BYTE *lpStream, DWORD d
if (insflags[iRaw-1] & 2) flags |= RSF_STEREO;
if (inspack[iRaw-1] == 4) flags = RS_ADPCM4;
dwMemPos = insfile[iRaw];
- dwMemPos += ReadSample(&Ins[iRaw], flags, (LPSTR)(lpStream + dwMemPos), dwMemLength - dwMemPos);
+ if (dwMemPos < dwMemLength)
+ dwMemPos += ReadSample(&Ins[iRaw], flags, (LPSTR)(lpStream + dwMemPos), dwMemLength - dwMemPos);
}
m_nMinPeriod = 64;
m_nMaxPeriod = 32767;

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_load_wav_cpp,v 1.1 2011/08/18 17:56:48 jasper Exp $
Fix integer overflow (SA45131/A)
From upstream git: 2d4c56de314ab13e4437bd8b609f0b751066eee8
--- src/load_wav.cpp.orig Thu Aug 18 19:37:38 2011
+++ src/load_wav.cpp Thu Aug 18 19:37:57 2011
@@ -54,7 +54,7 @@ BOOL CSoundFile::ReadWav(const BYTE *lpStream, DWORD d
if ((Patterns[1] = AllocatePattern(64, 4)) == NULL) return TRUE;
UINT samplesize = (pfmt->channels * pfmt->bitspersample) >> 3;
UINT len = pdata->length, bytelen;
- if (dwMemPos + len > dwMemLength - 8) len = dwMemLength - dwMemPos - 8;
+ if (len > dwMemLength - 8 - dwMemPos) len = dwMemLength - dwMemPos - 8;
len /= samplesize;
bytelen = len;
if (pfmt->bitspersample >= 16) bytelen *= 2;

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-src_sndfile_cpp,v 1.1 2011/05/05 21:25:48 jasper Exp $
Fixed possible memory overread in CSoundFile::AdjustSampleLoop().
From upstream git: fda0caf6490bb76cba349ae3e198b0d11d35c7c0
--- src/sndfile.cpp.orig Fri Mar 25 23:02:07 2011
+++ src/sndfile.cpp Thu May 5 23:22:01 2011
@@ -1550,7 +1550,9 @@ void CSoundFile::AdjustSampleLoop(MODINSTRUMENT *pIns)
//----------------------------------------------------
{
if (!pIns->pSample) return;
+ if (pIns->nLength > MAX_SAMPLE_LENGTH) pIns->nLength = MAX_SAMPLE_LENGTH;
if (pIns->nLoopEnd > pIns->nLength) pIns->nLoopEnd = pIns->nLength;
+ if (pIns->nLoopStart > pIns->nLength+2) pIns->nLoopStart = pIns->nLength+2;
if (pIns->nLoopStart+2 >= pIns->nLoopEnd)
{
pIns->nLoopStart = pIns->nLoopEnd = 0;

View File

@ -1,2 +0,0 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2010/11/07 00:44:09 jeremy Exp $
@lib lib/libmodplug.so.${LIBmodplug_VERSION}

View File

@ -1,5 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2010/11/07 00:44:09 jeremy Exp $
%%SHARED%%
@comment $OpenBSD: PLIST,v 1.2 2013/10/11 17:28:20 bcallah Exp $
include/libmodplug/
include/libmodplug/it_defs.h
include/libmodplug/modplug.h
@ -7,5 +6,6 @@ include/libmodplug/sndfile.h
include/libmodplug/stdafx.h
lib/libmodplug.a
lib/libmodplug.la
@lib lib/libmodplug.so.${LIBmodplug_VERSION}
lib/pkgconfig/
lib/pkgconfig/libmodplug.pc