]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Added a check in the WAV loading code to make sure the file is a WAV file before...
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 20 Jan 2004 13:18:49 +0000 (13:18 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 20 Jan 2004 13:18:49 +0000 (13:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3817 d7cf8633-e32d-0410-b094-e92efae38249

snd_mem.c

index 81b0db1537fcbdb9d97eb28d2b99a34fedd4f6ff..4e9f5cb53b5080b2451379ecfd4ed6c1699cebe5 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -225,6 +225,10 @@ sfxcache_t *S_LoadWavFile (const char *filename, sfx_t *s)
        if (!data)
                return NULL;
 
+       // Don't try to load it if it's not a WAV file
+       if (memcmp (data, "RIFF", 4) || memcmp (data + 8, "WAVE", 4))
+               return NULL;
+
        info = GetWavinfo (s->name, data, fs_filesize);
        // Stereo sounds are allowed (intended for music)
        if (info.channels < 1 || info.channels > 2)