From 33187588555ca6f5f969fd164d8a0ed05017710d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 31 May 2020 18:31:14 +0200 Subject: [PATCH] Fix crash on Session Export when master-bus has too many channels --- gtk2_ardour/export_channel_selector.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc index 2e59e4c140..08636e8739 100644 --- a/gtk2_ardour/export_channel_selector.cc +++ b/gtk2_ardour/export_channel_selector.cc @@ -165,9 +165,7 @@ PortExportChannelSelector::RouteCols::add_channels (uint32_t chans) PortExportChannelSelector::RouteCols::Channel & PortExportChannelSelector::RouteCols::get_channel (uint32_t channel) { - if (channel > n_channels) { - std::cout << "Invalid channel count for get_channel!" << std::endl; - } + assert (channel > 0 && channel <= channels.size ()); std::list::iterator it = channels.begin(); @@ -274,7 +272,9 @@ PortExportChannelSelector::ChannelTreeView::set_config (ChannelConfigPtr c) r_it->set_value (route_cols.get_channel (i).label, label); } - ++i; + if (++i > n_channels) { + break; + } } }