Prevent out of bound read in Sample::playRaw (#7113)

This commit is contained in:
Pascal
2024-02-17 22:48:17 +07:00
committed by GitHub
parent a81ad74e3a
commit 99120f567d

View File

@@ -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; }