From e2aaa075b1a1c6f91b853882b84cf04663929347 Mon Sep 17 00:00:00 2001 From: saker Date: Sun, 11 Feb 2024 13:28:47 -0500 Subject: [PATCH] Handle potential off by one access --- src/core/Sample.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Sample.cpp b/src/core/Sample.cpp index cf051b7b988..94f459adf80 100644 --- a/src/core/Sample.cpp +++ b/src/core/Sample.cpp @@ -198,7 +198,7 @@ void Sample::playRaw(sampleFrame* dst, size_t numFrames, const PlaybackState* st break; } - dst[i] = m_buffer->data()[m_reversed ? m_buffer->size() - index : index]; + dst[i] = m_buffer->data()[m_reversed ? m_buffer->size() - index - 1 : index]; backwards ? --index : ++index; } }