diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index d46656c4c7..c39a78ff7f 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -2940,6 +2940,11 @@ TempoMap::get_grid (vector& points, if (cnt < 0.0) { cnt = 0.0; } + + if (frame_at_beat_locked (_metrics, cnt) >= upper) { + return; + } + while (pos < upper) { pos = frame_at_beat_locked (_metrics, cnt); const TempoSection tempo = tempo_section_at_frame_locked (_metrics, pos);