From 35b49b302dfbffc265f9afd8c0cf6b194febccff Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 8 Oct 2013 07:18:32 +0200 Subject: [PATCH] CNeutrinoApp::handleMsg: -fix segfault if Bouquets is empty --- src/neutrino.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 71f48daac..d4e856ab4 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2370,7 +2370,9 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) _show: int nNewChannel = -1; int old_b = bouquetList->getActiveBouquetNumber(); - t_channel_id old_id = bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->getActiveChannel_ChannelID(); + t_channel_id old_id = 0; + if(!bouquetList->Bouquets.empty()) + old_id = bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->getActiveChannel_ChannelID(); //int old_mode = g_settings.channel_mode; int old_mode = GetChannelMode(); printf("************************* ZAP START: bouquetList %p size %d old_b %d\n", bouquetList, (int)bouquetList->Bouquets.size(), old_b);fflush(stdout);