summaryrefslogtreecommitdiff
path: root/coreengine
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2016-02-13 06:52:31 +0100
committerlouis <louis.braun@gmx.de>2016-02-13 06:52:31 +0100
commit777c1addda7592816d61a3a0bc97c09aebacb5c0 (patch)
treecc8b9b8f05caa61a5dd9ce76791dc6175a50791b /coreengine
parent18f30587a38b523605e5e4a585a359e77911477b (diff)
downloadvdr-plugin-skindesigner-777c1addda7592816d61a3a0bc97c09aebacb5c0.tar.gz
vdr-plugin-skindesigner-777c1addda7592816d61a3a0bc97c09aebacb5c0.tar.bz2
fixed crash if not visible menuitem is called
Diffstat (limited to 'coreengine')
-rw-r--r--coreengine/viewlist.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/coreengine/viewlist.c b/coreengine/viewlist.c
index 796132d..86760b5 100644
--- a/coreengine/viewlist.c
+++ b/coreengine/viewlist.c
@@ -327,6 +327,8 @@ void cViewListDefault::SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5)
}
void cViewListDefault::Set(const char *text, int index, bool current, bool selectable) {
+ if (index < 0 || index >= numElements)
+ return;
if (!current)
listDefault[index]->StopScrolling();
listDefault[index]->SetCurrent(current);
@@ -403,6 +405,8 @@ void cViewListMain::Prepare(int start, int step) {
}
void cViewListMain::Set(const char *text, int index, bool current, bool selectable) {
+ if (index < 0 || index >= numElements)
+ return;
if (!current)
listMain[index]->StopScrolling();
listMain[index]->SetCurrent(current);
@@ -481,6 +485,8 @@ void cViewListSchedules::Prepare(int start, int step) {
void cViewListSchedules::Set(const cEvent *event, int index, bool current, bool selectable,
const cChannel *channel, bool withDate, eTimerMatch timerMatch) {
+ if (index < 0 || index >= numElements)
+ return;
if (!current)
listSchedules[index]->StopScrolling();
listSchedules[index]->SetCurrent(current);
@@ -550,6 +556,8 @@ void cViewListTimers::Prepare(int start, int step) {
}
void cViewListTimers::Set(const cTimer *timer, int index, bool current, bool selectable) {
+ if (index < 0 || index >= numElements)
+ return;
if (!current)
listTimers[index]->StopScrolling();
listTimers[index]->SetCurrent(current);
@@ -618,6 +626,8 @@ void cViewListChannels::Prepare(int start, int step) {
}
void cViewListChannels::Set(const cChannel *channel, int index, bool current, bool selectable, bool withProvider) {
+ if (index < 0 || index >= numElements)
+ return;
if (!current)
listChannels[index]->StopScrolling();
listChannels[index]->SetCurrent(current);
@@ -686,6 +696,8 @@ void cViewListRecordings::Prepare(int start, int step) {
}
void cViewListRecordings::Set(const cRecording *recording, int index, bool current, bool selectable, int level, int total, int New) {
+ if (index < 0 || index >= numElements)
+ return;
if (!current)
listRecordings[index]->StopScrolling();
listRecordings[index]->SetCurrent(current);
@@ -762,7 +774,9 @@ void cViewListPlugin::Prepare(int start, int step) {
}
void cViewListPlugin::Set(skindesignerapi::cTokenContainer *tk, int index, bool current, bool selectable) {
- if (!current)
+ if (index < 0 || index >= numElements)
+ return;
+ if (!current)
listPlugin[index]->StopScrolling();
listPlugin[index]->SetCurrent(current);
listPlugin[index]->ClearCurrentElement();