diff options
author | mycroft <mycroft> | 1998-03-11 16:14:01 +0000 |
---|---|---|
committer | mycroft <mycroft> | 1998-03-11 16:14:01 +0000 |
commit | 5bf0c186d8ae05e3e130d586a0ea1cfd9cb167fa (patch) | |
tree | 3a0eb6abce0e21d787945ca374e4423159c43874 /audio/mikmod | |
parent | ceaef151e6bcc1e2537e39f6fb13868839a3d7e7 (diff) | |
download | pkgsrc-5bf0c186d8ae05e3e130d586a0ea1cfd9cb167fa.tar.gz |
Check for EOF so we don't core dump on some bad files.
Diffstat (limited to 'audio/mikmod')
-rw-r--r-- | audio/mikmod/patches/patch-af | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/audio/mikmod/patches/patch-af b/audio/mikmod/patches/patch-af new file mode 100644 index 00000000000..64032c7acda --- /dev/null +++ b/audio/mikmod/patches/patch-af @@ -0,0 +1,51 @@ +--- load_xm.c.orig Sun Aug 4 06:02:57 1996 ++++ load_xm.c Wed Mar 11 11:07:41 1998 +@@ -404,6 +404,11 @@ + /* printf("numrows: %d\n",ph.numrows); */ + /* printf("packsize:%d\n",ph.packsize); */ + ++ if(feof(modfp)){ ++ myerr = ERROR_LOADING_PATTERN; ++ return 0; ++ } ++ + of.pattrows[t]=ph.numrows; + + /* +@@ -448,6 +453,12 @@ + printf("Samples:%d\n",ih.numsmp); + printf("sampleheadersize:%ld\n",ih.ssize); + */ ++ ++ if(feof(modfp)){ ++ myerr = ERROR_LOADING_SAMPLEINFO; ++ return 0; ++ } ++ + d->insname=DupStr(ih.name,22); + d->numsmp=ih.numsmp; + +@@ -477,6 +488,11 @@ + pth.volfade =_mm_read_I_UWORD(modfp); + _mm_read_I_UWORDS(pth.reserved, 11, modfp); + ++ if(feof(modfp)){ ++ myerr = ERROR_LOADING_SAMPLEINFO; ++ return 0; ++ } ++ + memcpy(d->samplenumber,pth.what,96); + + d->volfade=pth.volfade; +@@ -573,6 +589,11 @@ + _mm_read_str(wh.samplename, 22, modfp); + + /*printf("wav %d:%22.22s\n",u,wh.samplename);*/ ++ ++ if(feof(modfp)){ ++ myerr = ERROR_LOADING_SAMPLEINFO; ++ return 0; ++ } + + q->samplename =DupStr(wh.samplename,22); + q->length =wh.length; |