From 513b24ccd77394b50128434376261615fd13b71e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 31 Mar 2006 12:41:50 +0200 Subject: [PATCH] Fixed handling broken PMT records --- CONTRIBUTORS | 1 + HISTORY | 5 +++++ config.h | 6 +++--- pat.c | 7 ++++++- pat.h | 3 ++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f44f4379..184356c3 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -780,6 +780,7 @@ Marcel Wiesweg for fixing a possible crash with inconsistent SI data for pointing out a problem with the cChannel copy constructor for fixing cDvbTuner to avoid lockups on NPTL systems + for pointing out how to detect broken PMT records Torsten Herz for fixing a possible deadlock when using the "Blue" button in the "Schedules" menu diff --git a/HISTORY b/HISTORY index ad85a22c..dc278bbd 100644 --- a/HISTORY +++ b/HISTORY @@ -4455,3 +4455,8 @@ Video Disk Recorder Revision History - Single shot VPS timers are now only considered 'expired' if their associated EPG event has been explicitly set to SI::RunningStatusNotRunning. - The check for timers to be deleted is now done only every 30 seconds. + +2006-03-31: Version 1.3.46 + +- Fixed handling broken PMT records (thanks to Marcel Wiesweg for pointing out how + to detect these). diff --git a/config.h b/config.h index 07f48cf5..8cf92c04 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.247 2006/02/28 12:23:28 kls Exp $ + * $Id: config.h 1.248 2006/03/31 12:41:50 kls Exp $ */ #ifndef __CONFIG_H @@ -19,8 +19,8 @@ #include "i18n.h" #include "tools.h" -#define VDRVERSION "1.3.45" -#define VDRVERSNUM 10345 // Version * 10000 + Major * 100 + Minor +#define VDRVERSION "1.3.46" +#define VDRVERSNUM 10346 // Version * 10000 + Major * 100 + Minor #define MAXPRIORITY 99 #define MAXLIFETIME 99 diff --git a/pat.c b/pat.c index a7216b8c..f898c70d 100644 --- a/pat.c +++ b/pat.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: pat.c 1.15 2006/01/27 15:48:29 kls Exp $ + * $Id: pat.c 1.16 2006/03/31 12:39:34 kls Exp $ */ #include "pat.h" @@ -232,6 +232,7 @@ cPatFilter::cPatFilter(void) { pmtIndex = 0; pmtPid = 0; + pmtSid = 0; lastPmtScan = 0; numPmtEntries = 0; Set(0x00, 0x00); // PAT @@ -242,6 +243,7 @@ void cPatFilter::SetStatus(bool On) cFilter::SetStatus(On); pmtIndex = 0; pmtPid = 0; + pmtSid = 0; lastPmtScan = 0; numPmtEntries = 0; } @@ -289,6 +291,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length if (!assoc.isNITPid()) { if (Index++ >= pmtIndex && Channels.GetByServiceID(Source(), Transponder(), assoc.getServiceId())) { pmtPid = assoc.getPid(); + pmtSid = assoc.getServiceId(); Add(pmtPid, 0x02); break; } @@ -303,6 +306,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length SI::PMT pmt(Data, false); if (!pmt.CheckCRCAndParse()) return; + if (pmt.getServiceId() != pmtSid) + return; // skip broken PMT records if (!PmtVersionChanged(pmtPid, pmt.getTableIdExtension(), pmt.getVersionNumber())) { lastPmtScan = 0; // this triggers the next scan return; diff --git a/pat.h b/pat.h index 6246cc0c..88b2115b 100644 --- a/pat.h +++ b/pat.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: pat.h 1.5 2006/03/26 14:09:43 kls Exp $ + * $Id: pat.h 1.6 2006/03/29 15:18:38 kls Exp $ */ #ifndef __PAT_H @@ -20,6 +20,7 @@ private: time_t lastPmtScan; int pmtIndex; int pmtPid; + int pmtSid; uint64_t pmtVersion[MAXPMTENTRIES]; int numPmtEntries; bool PmtVersionChanged(int PmtPid, int Sid, int Version);