summaryrefslogtreecommitdiff
path: root/soundlib/Load_mtm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'soundlib/Load_mtm.cpp')
-rw-r--r--soundlib/Load_mtm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/soundlib/Load_mtm.cpp b/soundlib/Load_mtm.cpp
index 3819602..0c2231a 100644
--- a/soundlib/Load_mtm.cpp
+++ b/soundlib/Load_mtm.cpp
@@ -54,7 +54,7 @@ struct MTMSampleHeader
{
mptSmp.nLength = length;
mptSmp.nLoopStart = loopStart;
- mptSmp.nLoopEnd = loopEnd;
+ mptSmp.nLoopEnd = std::max(loopEnd.get(), uint32(1)) - 1;
LimitMax(mptSmp.nLoopEnd, mptSmp.nLength);
if(mptSmp.nLoopStart + 4 >= mptSmp.nLoopEnd) mptSmp.nLoopStart = mptSmp.nLoopEnd = 0;
if(mptSmp.nLoopEnd) mptSmp.uFlags.set(CHN_LOOP);