diff --git a/src/i_oalsound.c b/src/i_oalsound.c index bfd7da4d..71ba7500 100644 --- a/src/i_oalsound.c +++ b/src/i_oalsound.c @@ -589,7 +589,7 @@ boolean I_OAL_CacheSound(sfxinfo_t *sfx) lumplen = W_LumpLength(lumpnum); // Check the header, and ensure this is a valid sound - if (lumpdata[0] == 0x03 && lumpdata[1] == 0x00) + if (lumplen > DMXHDRSIZE && lumpdata[0] == 0x03 && lumpdata[1] == 0x00) { freq = (lumpdata[3] << 8) | lumpdata[2]; size = (lumpdata[7] << 24) | (lumpdata[6] << 16) |