From 626021e0eb3a54e18c2f5c72cf13e6278717ed7e Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 10 Dec 2023 18:20:03 +0700 Subject: [PATCH] fix zero length sounds (#1315) * fix zero length sounds DSSAWUP sound in "Eviternity II RC1.wad" * better fix * another variant --- src/i_oalsound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) |