From bdac1c3ad1a72feeff68e9ef1a0e62cf86180012 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 8 May 2017 18:06:15 +0300 Subject: [PATCH] Fixed problem with looping of particular music tracks Part of https://forum.zdoom.org/viewtopic.php?t=56333 --- src/sound/musicformats/music_libsndfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sound/musicformats/music_libsndfile.cpp b/src/sound/musicformats/music_libsndfile.cpp index d14c6b3ad..85b670a6b 100644 --- a/src/sound/musicformats/music_libsndfile.cpp +++ b/src/sound/musicformats/music_libsndfile.cpp @@ -339,7 +339,7 @@ bool SndFileSong::Read(SoundStream *stream, void *vbuff, int ilen, void *userdat if (currentpos + framestoread > song->Loop_End) { size_t endblock = (song->Loop_End - currentpos) * song->Channels * 2; - size_t endlen = song->Decoder->read(buff, endblock); + size_t endlen = song->Decoder->read(buff, 0 == endblock ? len : endblock); if (endlen != 0) { buff = buff + endlen;