From fbb3a50e9a19f9e1053f5ed437abfad70482b6be Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 13 Mar 2020 13:26:29 +0200 Subject: [PATCH] - fixed wrong point values in loop tags parser https://forum.zdoom.org/viewtopic.php?t=67812 --- source/streamsources/music_libsndfile.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/streamsources/music_libsndfile.cpp b/source/streamsources/music_libsndfile.cpp index 9c9a6b2..7248c90 100644 --- a/source/streamsources/music_libsndfile.cpp +++ b/source/streamsources/music_libsndfile.cpp @@ -234,26 +234,32 @@ static void ParseVorbisComments(MusicIO::FileInterface *fr, uint32_t *start, zmu for (auto tag : loopStartTags) { - if (!strnicmp(strdat, tag, strlen(tag))) + const size_t tagLength = strlen(tag); + + if (!strnicmp(strdat, tag, tagLength)) { - S_ParseTimeTag(strdat + 11, startass, start); + S_ParseTimeTag(strdat + tagLength, startass, start); break; } } for (auto tag : loopEndTags) { - if (!strnicmp(strdat, tag, strlen(tag))) + const size_t tagLength = strlen(tag); + + if (!strnicmp(strdat, tag, tagLength)) { - S_ParseTimeTag(strdat + 11, endass, end); + S_ParseTimeTag(strdat + tagLength, endass, end); endfound = true; break; } } for (auto tag : loopLengthTags) { - if (!strnicmp(strdat, tag, strlen(tag))) + const size_t tagLength = strlen(tag); + + if (!strnicmp(strdat, tag, tagLength)) { - S_ParseTimeTag(strdat + 11, &loopass, &looplen); + S_ParseTimeTag(strdat + tagLength, &loopass, &looplen); *end += *start; break; }