From c2ce0bcb4a58c98e3485eafc26045cb0466e2817 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 6 Sep 2023 01:01:30 +0200 Subject: [PATCH] Amend 101744b8, allow `when` and `start` to point to the same variable --- libs/ardour/location.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 3b06c9b090..74eb047668 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -1633,9 +1633,10 @@ Locations::section_at (timepos_t const& when, timepos_t& start, timepos_t& end) return NULL; } - Location* rv = NULL; + Location* rv = NULL; + timepos_t test = when; for (auto const& i: locs) { - if (when >= i.first) { + if (test >= i.first) { start = i.first; rv = i.second; } else {