소스 검색

fix index out of range check in GetCoefficientAtIndex (#164)

Daniel Zauner 1 년 전
부모
커밋
5ff962be37
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs

+ 1 - 1
src/Ryujinx.Audio/Renderer/Dsp/AdpcmHelper.cs

@@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Renderer.Dsp
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         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}");