From 7e698f4605f6791dbfdd627e2508d2ce9806e9b8 Mon Sep 17 00:00:00 2001 From: Daniel Zauner Date: Sat, 2 Nov 2024 14:52:38 +0100 Subject: [PATCH] fix index out of range check in GetCoefficientAtIndex --- src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs b/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs index 5cb4509ff..8b497fe2a 100644 --- a/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs +++ b/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs @@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Renderer.Dsp [MethodImpl(MethodImplOptions.AggressiveInlining)] private static short GetCoefficientAtIndex(ReadOnlySpan coefficients, int index) { - if ((uint)index > (uint)coefficients.Length) + if ((uint)index >= (uint)coefficients.Length) { Logger.Error?.Print(LogClass.AudioRenderer, $"Out of bound read for coefficient at index {index}"); -- 2.47.1