From 99120f567d54b95c2d1a8e786f5d3a3f9713f715 Mon Sep 17 00:00:00 2001 From: Pascal <81458575+khoidauminh@users.noreply.github.com> Date: Sat, 17 Feb 2024 22:48:17 +0700 Subject: [PATCH] Prevent out of bound read in `Sample::playRaw` (#7113) --- 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 333ee624d..a07b100bf 100644 --- a/src/core/Sample.cpp +++ b/src/core/Sample.cpp @@ -178,7 +178,7 @@ void Sample::playRaw(sampleFrame* dst, size_t numFrames, const PlaybackState* st switch (loopMode) { case Loop::Off: - if (index < 0 || index > m_endFrame) { return; } + if (index < 0 || index >= m_endFrame) { return; } break; case Loop::On: if (index < m_loopStartFrame && backwards) { index = m_loopEndFrame - 1; }