From 94ba45c0571e6822268edf0ea3279901d0b93e63 Mon Sep 17 00:00:00 2001 From: Jesse Chappell Date: Mon, 20 Feb 2006 21:40:20 +0000 Subject: [PATCH] fixed crash potential issues where nframes may be 0 git-svn-id: svn://localhost/trunk/ardour2@341 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/io.cc | 2 ++ libs/ardour/panner.cc | 3 ++- libs/ardour/route.cc | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 91cbb1cb67..916e77b492 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -163,6 +163,8 @@ IO::apply_declick (vector& bufs, uint32_t nbufs, jack_nframes_t nframe double fractional_shift; double fractional_pos; gain_t polscale = invert_polarity ? -1.0f : 1.0f; + + if (nframes == 0) return; fractional_shift = -1.0/declick; diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 85feed6be9..6b0013cada 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -613,7 +613,8 @@ EqualPowerStereoPanner::distribute_automated (Sample* src, Sample** obufs, /* store effective pan position. do this even if we are muted */ - effective_x = buffers[0][nframes-1]; + if (nframes > 0) + effective_x = buffers[0][nframes-1]; if (_muted) { return; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 5d3cd942e7..7f7b56cc2b 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -444,7 +444,7 @@ Route::process_output_buffers (vector& bufs, uint32_t nbufs, } } - if (apply_gain_automation && _session.transport_rolling()) { + if (apply_gain_automation && _session.transport_rolling() && nframes > 0) { _effective_gain = gab[nframes-1]; } -- 2.30.2