fix index out of range check in GetCoefficientAtIndex

This commit is contained in:
Daniel Zauner 2024-11-02 14:52:38 +01:00
parent 04f014c777
commit 7e698f4605

View File

@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Renderer.Dsp
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static short GetCoefficientAtIndex(ReadOnlySpan<short> coefficients, int index) private static short GetCoefficientAtIndex(ReadOnlySpan<short> 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}"); Logger.Error?.Print(LogClass.AudioRenderer, $"Out of bound read for coefficient at index {index}");