diff --git a/src/audio/WaveFileReader.cpp b/src/audio/WaveFileReader.cpp index e0dd08f..c3cdf64 100644 --- a/src/audio/WaveFileReader.cpp +++ b/src/audio/WaveFileReader.cpp @@ -188,7 +188,7 @@ void WaveFileReader::seek(int64_t frameIndex) { } float WaveFileReader::readSample() { - if (frameIndex + channelCount > frameCount) throw std::out_of_range("End of stream."); + if (frameIndex >= frameCount) throw std::out_of_range("End of stream."); ++frameIndex; float sum = 0;