fix potential crash in LV2Plugin::connect_and_run() when music starts after 0
authornick_m <mainsbridge@gmail.com>
Thu, 9 Mar 2017 16:59:25 +0000 (03:59 +1100)
committernick_m <mainsbridge@gmail.com>
Thu, 9 Mar 2017 16:59:25 +0000 (03:59 +1100)
libs/ardour/tempo.cc

index bb61fb70127a368dfd57d13a68226ffc9adddd6d..cc40ef5532a3496357b3ea82a0ca15db826e81ff 100644 (file)
@@ -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.