From b4406a585414df735309a6e5055ec2c2975d551a Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Sun, 12 May 2024 11:02:12 +0200 Subject: [PATCH] fix(DmPerformance): properly handle `0` in segment loop end --- src/Performance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Performance.c b/src/Performance.c index 6136f56..7f3c83d 100644 --- a/src/Performance.c +++ b/src/Performance.c @@ -710,7 +710,7 @@ static void DmPerformance_handleSegmentMessage(DmPerformance* slf, DmMessage_Seg // NOTE: If we have a different `play_start` or `loop_start`, we need to discard messages // before it and make sure to re-align them at time 0. uint32_t start = msg->loop != 0 ? sgt->loop_start : sgt->play_start; - uint32_t end = msg->loop != 0 ? sgt->loop_end : sgt->length; + uint32_t end = (msg->loop != 0 && sgt->loop_end != 0) ? sgt->loop_end : sgt->length; for (size_t i = 0; i < sgt->messages.length; ++i) { DmMessage* m = &sgt->messages.data[i];