From 15030f6acece1060f9736f875fe3abbcf9392263 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 8 Aug 2004 14:31:33 +0200 Subject: Fixed a crash in case the last line in channels.conf is a group separator --- CONTRIBUTORS | 4 ++++ HISTORY | 2 ++ menu.c | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 50b2d3d2..1e7f92a5 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1064,3 +1064,7 @@ J Mike parker for helping to test support for NVOD channels + +Dick Streefland + for fixing a crash in case the last line in channels.conf is a group separator and + that group is selected in the channel display diff --git a/HISTORY b/HISTORY index 54ae9935..1b533929 100644 --- a/HISTORY +++ b/HISTORY @@ -2974,3 +2974,5 @@ Video Disk Recorder Revision History (thanks to Andreas Share for pointing this out). - Fixed a possible NULL pointer assignment in cMenuText::SetText() (thanks to Marco Schlüssler). +- Fixed a crash in case the last line in channels.conf is a group separator and + that group is selected in the channel display (thanks to Dick Streefland). diff --git a/menu.c b/menu.c index d297d04e..512cd3a9 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.310 2004/08/08 14:19:37 kls Exp $ + * $Id: menu.c 1.311 2004/08/08 14:29:14 kls Exp $ */ #include "menu.h" @@ -2628,8 +2628,11 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key) //TODO //XXX case kGreen: return osEventNow; //XXX case kYellow: return osEventNext; - case kOk: if (group >= 0) - Channels.SwitchTo(Channels.Get(Channels.GetNextNormal(group))->Number()); + case kOk: if (group >= 0) { + cChannel *channel = Channels.Get(Channels.GetNextNormal(group)); + if (channel) + Channels.SwitchTo(channel->Number()); + } return osEnd; default: if ((Key & (k_Repeat | k_Release)) == 0) { cRemote::Put(Key); -- cgit v1.2.3