doom: fix out-of-bounds access of caps->samprs

Change-Id: Icde0146648477dbd0442c67258ff6ae1ff62c994
This commit is contained in:
mojyack 2026-03-31 12:16:46 +09:00
parent b5e3789dc1
commit 4cd3d3c519

View file

@ -491,8 +491,9 @@ void I_InitSound()
break; break;
} }
if (i == caps->num_samprs) if (i == caps->num_samprs)
i = SAMPR_44; samplerate = SAMPR_44;
samplerate = caps->samprs[i]; else
samplerate = caps->samprs[i];
// Initialize external data (all sounds) at start, keep static. // Initialize external data (all sounds) at start, keep static.
printf( "I_InitSound: "); printf( "I_InitSound: ");