diff --git a/source/backend/native/audiofile.c b/source/backend/native/audiofile.c index 501e518c1..806a15209 100644 --- a/source/backend/native/audiofile.c +++ b/source/backend/native/audiofile.c @@ -159,7 +159,7 @@ void audiofile_read_poll(AudioFileInstance* const handlePtr) } } - if (handlePtr->loopMode && readFrame+j == handlePtr->maxFrame) + if (handlePtr->loopMode && i < handlePtr->pool.size) { while (i < handlePtr->pool.size) {