diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 9a8fd3817..6765a66b5 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -1168,7 +1168,11 @@ bool Sequence::CopyWrite(SampleBuffer &scratch, bool Sequence::Get(samplePtr buffer, sampleFormat format, sampleCount start, sampleCount len) const { - if (start < 0 || start >= mNumSamples || + if (start == mNumSamples) { + return len == 0; + } + + if (start < 0 || start > mNumSamples || start + len > mNumSamples) return false; int b = FindBlock(start);