From 4cd3d3c5193ee13f1b577c3a197a4d0f7243276b Mon Sep 17 00:00:00 2001 From: mojyack Date: Tue, 31 Mar 2026 12:16:46 +0900 Subject: [PATCH] doom: fix out-of-bounds access of caps->samprs Change-Id: Icde0146648477dbd0442c67258ff6ae1ff62c994 --- apps/plugins/doom/i_sound.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/plugins/doom/i_sound.c b/apps/plugins/doom/i_sound.c index 53a172694b..78780dd9b3 100644 --- a/apps/plugins/doom/i_sound.c +++ b/apps/plugins/doom/i_sound.c @@ -491,8 +491,9 @@ void I_InitSound() break; } if (i == caps->num_samprs) - i = SAMPR_44; - samplerate = caps->samprs[i]; + samplerate = SAMPR_44; + else + samplerate = caps->samprs[i]; // Initialize external data (all sounds) at start, keep static. printf( "I_InitSound: ");