fixed crash potential issues where nframes may be 0
authorJesse Chappell <jesse@essej.net>
Mon, 20 Feb 2006 21:40:20 +0000 (21:40 +0000)
committerJesse Chappell <jesse@essej.net>
Mon, 20 Feb 2006 21:40:20 +0000 (21:40 +0000)
git-svn-id: svn://localhost/trunk/ardour2@341 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/io.cc
libs/ardour/panner.cc
libs/ardour/route.cc

index 91cbb1cb67e1cf90923c4d8581bcfd7e8c72dbd6..916e77b492ca61d420053815687387e549421a08 100644 (file)
@@ -163,6 +163,8 @@ IO::apply_declick (vector<Sample *>& 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;
 
index 85feed6be906416b2f19a85da172c81a8b360987..6b0013cada2d5b1697c664b45946351af85cb3ef 100644 (file)
@@ -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;
index 5d3cd942e7f2c6afc400cbb4a97f1f6c259d90cf..7f7b56cc2bbea152ae3a13916b46b3d388e8177f 100644 (file)
@@ -444,7 +444,7 @@ Route::process_output_buffers (vector<Sample*>& 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];
                        }