diff --git a/src/sound/musicformats/music_libsndfile.cpp b/src/sound/musicformats/music_libsndfile.cpp index e8a6132789..91951c18b0 100644 --- a/src/sound/musicformats/music_libsndfile.cpp +++ b/src/sound/musicformats/music_libsndfile.cpp @@ -333,8 +333,8 @@ bool SndFileSong::Read(SoundStream *stream, void *vbuff, int ilen, void *userdat size_t endlen = song->Decoder->read(buff, endblock); if (endlen != 0) { - buff = buff + endblock; - len -= endblock; + buff = buff + endlen; + len -= endlen; song->Decoder->seek(song->Loop_Start, false, true); } else