From 87d474b39114ae856dd8880142c206971b81878a Mon Sep 17 00:00:00 2001 From: nick_m Date: Fri, 10 Mar 2017 03:59:25 +1100 Subject: fix potential crash in LV2Plugin::connect_and_run() when music starts after 0 --- libs/ardour/tempo.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs/ardour/tempo.cc') diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index bb61fb7012..cc40ef5532 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1609,6 +1609,10 @@ TempoMap::metric_at (framepos_t frame, Metrics::const_iterator* last) const Glib::Threads::RWLock::ReaderLock lm (lock); TempoMetric m (first_meter(), first_tempo()); + if (last) { + *last = ++_metrics.begin(); + } + /* at this point, we are *guaranteed* to have m.meter and m.tempo pointing at something, because we insert the default tempo and meter during TempoMap construction. -- cgit v1.2.3