Просмотр исходного кода

amadeus: Fix possible device sink input out of bound (#3032)

This fix an out of bound when indexing inputs for games that uses
unsupported values (8 here)

Close #2724.
Mary 4 лет назад
Родитель
Сommit
b2ebbe8b22
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs

+ 1 - 1
Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs

@@ -52,7 +52,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
             InputCount = sink.Parameter.InputCount;
             InputBufferIndices = new ushort[InputCount];
 
-            for (int i = 0; i < InputCount; i++)
+            for (int i = 0; i < Math.Min(InputCount, Constants.ChannelCountMax); i++)
             {
                 InputBufferIndices[i] = (ushort)(bufferOffset + sink.Parameter.Input[i]);
             }