From 0ee05f5ad8874e76b9c1effab4e9f8923e081f3a Mon Sep 17 00:00:00 2001 From: Pascal <81458575+khoidauminh@users.noreply.github.com> Date: Sun, 19 May 2024 05:40:29 +0700 Subject: [PATCH] Fix crash in AFP when playing with loop while no sample is loaded (#7266) --- src/core/Sample.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/Sample.cpp b/src/core/Sample.cpp index cd238b2ca9f..584d1bc13c9 100644 --- a/src/core/Sample.cpp +++ b/src/core/Sample.cpp @@ -170,6 +170,8 @@ void Sample::setAllPointFrames(int startFrame, int endFrame, int loopStartFrame, void Sample::playRaw(sampleFrame* dst, size_t numFrames, const PlaybackState* state, Loop loopMode) const { + if (m_buffer->size() < 1) { return; } + auto index = state->m_frameIndex; auto backwards = state->m_backwards;