summaryrefslogtreecommitdiff
path: root/audio/mikmod
diff options
context:
space:
mode:
authormycroft <mycroft@pkgsrc.org>1998-03-11 16:14:01 +0000
committermycroft <mycroft@pkgsrc.org>1998-03-11 16:14:01 +0000
commitc9b7e42bee228c13e433c34cf27e1bb783894e8d (patch)
tree3a0eb6abce0e21d787945ca374e4423159c43874 /audio/mikmod
parenta8a323d5d75cd1720fa06948a952fcee73150f80 (diff)
downloadpkgsrc-c9b7e42bee228c13e433c34cf27e1bb783894e8d.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-af51
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;