aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary <me@thog.eu>2020-11-21 21:57:49 +0100
committerGitHub <noreply@github.com>2020-11-21 21:57:49 +0100
commit92bcdcb369b5e37f681861231186786a8c7d407f (patch)
tree81af1c5cc42ecb725c91d38ba3e58ab74f7a689e
parent3dc9bab91f1ad5094360d581368024b7dfa17d0f (diff)
amadeus: Fix possible underflow in delay time delay effect (#1739)
This fix an underflow in the setup of delay time in the delay effect. THis fix a regression caused by Amadeus on Shovel Knight: Treasure Trove.
-rw-r--r--Ryujinx.Audio.Renderer/Dsp/Effect/DelayLine.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Ryujinx.Audio.Renderer/Dsp/Effect/DelayLine.cs b/Ryujinx.Audio.Renderer/Dsp/Effect/DelayLine.cs
index b443cd15..3766390a 100644
--- a/Ryujinx.Audio.Renderer/Dsp/Effect/DelayLine.cs
+++ b/Ryujinx.Audio.Renderer/Dsp/Effect/DelayLine.cs
@@ -42,7 +42,15 @@ namespace Ryujinx.Audio.Renderer.Dsp.Effect
{
CurrentSampleCount = Math.Min(SampleCountMax, targetSampleCount);
_currentSampleIndex = 0;
- _lastSampleIndex = CurrentSampleCount - 1;
+
+ if (CurrentSampleCount == 0)
+ {
+ _lastSampleIndex = 0;
+ }
+ else
+ {
+ _lastSampleIndex = CurrentSampleCount - 1;
+ }
}
public void SetDelay(float delayTime)