summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_diskstream.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2015-01-27 11:59:23 +0000
committerJohn Emmas <johne53@tiscali.co.uk>2015-01-27 11:59:23 +0000
commit302dc2bea34ac9b16b8010ce16f2bc72a3792fb1 (patch)
tree3b8b280f32f24d173272b8126f9ef9883556e1d3 /libs/ardour/audio_diskstream.cc
parent0f46d7b1076550054491d8668a7fcc9d21271574 (diff)
Don't try to dereference a NULL ptr (the function 'ARDOUR::IO::nth()' can return an invalid ptr, so let's make sure we test for it)
Note 1: Potentially we could have the same issue with 'AutomationLine::nth()' (although the current code seems okay) Note 2: This (specific) problem seems mostly to affect Mixbus3 when it tries to load an old (version2) session from Ardour2. Mixbus can mark certain IO ports as being 'unused'. While loading sessions, function 'ARDOUR::IO::ensure_ports_locked()' deletes any unused ports. But later, the function 'ARDOUR::IO::make_connections_2X()' was crashing while trying to connect those (now NULL) ports. This commit fixes that crash but there's some evidence that it might only have moved the problem elsewhere. The version2 sessions now open successfully - but an MSVC (Debug) build now crashes whilst closing them (the Release build however, is okay). Someone who's more familiar with the code than me should review the Mixbus3/Ardour2 loading procedure to make sure it's safe.
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r--libs/ardour/audio_diskstream.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index d835c4a20f..4facf5db64 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -225,7 +225,7 @@ AudioDiskstream::get_input_sources ()
connections.clear ();
- if (_io->nth (n)->get_connections (connections) == 0) {
+ if ((_io->nth (n).get()) && (_io->nth (n)->get_connections (connections) == 0)) {
if (!(*chan)->source.name.empty()) {
// _source->disable_metering ();
}