File libmikmod-CVE-2009-0179.patch of Package libmikmod

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;
openSUSE Build Service is sponsored by