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 {