aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2022-01-23 23:36:31 +0100
committerGitHub <noreply@github.com>2022-01-23 23:36:31 +0100
commitb2ebbe8b22f241a624ecba2e6084d255827dc25c (patch)
tree50f2b87608d0ba377c096182402ff375c112e8ec /Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs
parent4910b214f5c3d68dc112b4f6cec75bcdb4edf82b (diff)
amadeus: Fix possible device sink input out of bound (#3032)1.1.6
This fix an out of bound when indexing inputs for games that uses unsupported values (8 here) Close #2724.
Diffstat (limited to 'Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs')
-rw-r--r--Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs b/Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs
index 28b4a5f1..ca81e791 100644
--- a/Ryujinx.Audio/Renderer/Dsp/Command/DeviceSinkCommand.cs
+++ b/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]);
}