From 2aa072fbfa81aaa24e2df428e1167c2e00a3c8fc Mon Sep 17 00:00:00 2001 From: GreemDev Date: Sat, 24 May 2025 17:00:30 -0500 Subject: [PATCH] fix: Super Mario Party Jamboree audio renderer crashing See merge request ryubing/ryujinx!34 --- src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs b/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs index 8b497fe2a..1a5802a37 100644 --- a/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs +++ b/src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs @@ -81,14 +81,14 @@ 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}"); - - return 0; + return coefficients[index]; } - return coefficients[index]; + Logger.Error?.Print(LogClass.AudioRenderer, $"Out of bound read for coefficient at index {index}"); + + return 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)]