From d71ad8700a05f99bd422a0b837276a92eb9de14a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 23 Oct 2012 16:15:53 +0400 Subject: [PATCH] gui/bouquetlist.cpp: bouquet id safe-checks --- src/gui/bouquetlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 9e1d81f2b..f1e11d97b 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -171,7 +171,7 @@ bool CBouquetList::adjustToChannelID(t_channel_id channel_id) /* used in channellist to switch bouquets up/down */ int CBouquetList::showChannelList( int nBouquet) { - if (nBouquet == -1) + if ((nBouquet < 0)|| (nBouquet >= (int) Bouquets.size())) nBouquet = selected; int nNewChannel = Bouquets[nBouquet]->channelList->exec(); @@ -186,7 +186,7 @@ int CBouquetList::activateBouquet( int id, bool bShowChannelList) { int res = -1; - if(id < (int) Bouquets.size()) + if((id >= 0) && (id < (int) Bouquets.size())) selected = id; if (bShowChannelList) {