aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-04-18 02:20:06 +0200
committerGitHub <noreply@github.com>2021-04-18 02:20:06 +0200
commitd23511c25c22fc47c54da28854034c5fbc143e33 (patch)
tree4e2779ffc03358c5146b1c056c34b448f4e466d0
parent38be18ef2a36c9c6a35a49ff685df9ebbab8baa7 (diff)
Amadeus: Allow out of bound read on empty delay lines (#2223)
This allows to handle an OOB with delay lines when DelayTimeMax = 0. On real hardware, it will end up reading garbage at the given user work buffer address. As we do not use those buffers and allocate them ourself for simplicy, this could possibly cause a crash. Proposed solution here is to only increase the size of _workBuffer by one like what is done in DelayLineReverb3d already. This fixes FEZ. (Ryujinx/Ryujinx-Games-List#3526)
-rw-r--r--Ryujinx.Audio/Renderer/Dsp/Effect/DelayLine.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/Effect/DelayLine.cs b/Ryujinx.Audio/Renderer/Dsp/Effect/DelayLine.cs
index d178e699..1774f542 100644
--- a/Ryujinx.Audio/Renderer/Dsp/Effect/DelayLine.cs
+++ b/Ryujinx.Audio/Renderer/Dsp/Effect/DelayLine.cs
@@ -33,7 +33,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Effect
{
_sampleRate = sampleRate;
SampleCountMax = IDelayLine.GetSampleCount(_sampleRate, delayTimeMax);
- _workBuffer = new float[SampleCountMax];
+ _workBuffer = new float[SampleCountMax + 1];
SetDelay(delayTimeMax);
}