summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i_sound.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/i_sound.c b/src/i_sound.c
index 45ead1af..18be082f 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_sound.c 102 2005-09-11 23:57:08Z fraggle $
+// $Id: i_sound.c 152 2005-10-02 20:23:04Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.20 2005/10/02 20:23:04 fraggle
+// Guard against music lumps containing non-MUS data, document in bugs list
+//
// Revision 1.19 2005/09/11 23:57:08 fraggle
// Remove temporary MIDI files generated by sound code.
//
@@ -93,7 +96,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_sound.c 102 2005-09-11 23:57:08Z fraggle $";
+rcsid[] = "$Id: i_sound.c 152 2005-10-02 20:23:04Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
@@ -570,6 +573,12 @@ void *I_RegisterSong(void *data, int len)
if (!music_initialised)
return NULL;
+ // MUS files begin with "MUS"
+ // Reject anything which doesnt have this signature
+
+ if (len < 3 || memcmp(data, "MUS", 3) != 0)
+ return NULL;
+
#ifdef _WIN32
sprintf(filename, "doom.mid");
#else