new greek translations; fix for crash in diskstream due to removed port access
[ardour.git] / libs / ardour / audio_diskstream.cc
index 48085d4922985c58115231ac1680dc8f253b5626..b372c14b57d2b5927a877f003d8649dcefccd063 100644 (file)
@@ -610,7 +610,16 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
 
        if (nominally_recording || rec_nframes) {
 
-               for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
+               uint32_t limit = _io->n_inputs ();
+
+               /* one or more ports could already have been removed from _io, but our
+                  channel setup hasn't yet been updated. prevent us from trying to
+                  use channels that correspond to missing ports. note that the
+                  process callback (from which this is called) is always atomic
+                  with respect to port removal/addition.
+               */
+
+               for (n = 0, chan = c->begin(); chan != c->end() && n < limit; ++chan, ++n) {
                        
                        ChannelInfo* chaninfo (*chan);