Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] [PATCH] fix for crash on switch to empty group



When you have a group delimiter at the end of channels.conf, select
this (empty) group with the right arrow button, and then press OK,
vdr crashes because of a NULL pointer. The attached patch fixes this.

-- 
Dick Streefland                    ////               De Bilt
dick.streefland@xs4all.nl         (@ @)       The Netherlands
------------------------------oOO--(_)--OOo------------------
--- orig/vdr-1.3.12/menu.c	Sun Jun 13 22:26:51 2004
+++ vdr-1.3.12/menu.c	Wed Aug  4 21:31:22 2004
@@ -2628,8 +2656,11 @@
     //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* chan = Channels.Get(Channels.GetNextNormal(group));
+                     if (chan)
+                        Channels.SwitchTo(chan->Number());
+                     }
                   return osEnd;
     default:      if ((Key & (k_Repeat | k_Release)) == 0) {
                      cRemote::Put(Key);

Home | Main Index | Thread Index