Fixed off-by-one error in wave file reader

This commit is contained in:
Daniel Wolf 2016-06-21 21:47:08 +02:00
parent 0e00e58d91
commit 97f172282d
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ void WaveFileReader::seek(int64_t frameIndex) {
} }
float WaveFileReader::readSample() { 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; ++frameIndex;
float sum = 0; float sum = 0;