diff --git a/libntxm/common/source/sample.cpp b/libntxm/common/source/sample.cpp index f8fe094..04b5389 100644 --- a/libntxm/common/source/sample.cpp +++ b/libntxm/common/source/sample.cpp @@ -567,6 +567,9 @@ void Sample::delPart(u32 startsample, u32 endsample) } } + loop_start = ntxm_clamp(loop_start, 0, size - 1); + loop_length = ntxm_clamp(loop_length, 0, size - loop_start - 1); + setLoopStartAndLength(getLoopStart(), getLoopLength()); onSampleDataChanged(); }