From a291e3dc1c083185ed5588bd04ba27ba0ad27b75 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Sat, 15 Apr 2006 11:02:41 +0000 Subject: [PATCH 1/1] fix segfault on transponders with incorrect mjd entries in the TDT null pointer check before accessing sectionreader object --- lib/dvb/dvbtime.cpp | 3 ++- lib/dvb/esection.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/dvb/dvbtime.cpp b/lib/dvb/dvbtime.cpp index dff5c0c9..eb0ed692 100644 --- a/lib/dvb/dvbtime.cpp +++ b/lib/dvb/dvbtime.cpp @@ -84,7 +84,8 @@ int TDT::createTable(int nr, const __u8 *data, unsigned int max) if ( length >= 5 ) { time_t tptime = parseDVBtime(data[3], data[4], data[5], data[6], data[7]); - eDVBLocalTimeHandler::getInstance()->updateTime(tptime, chan, update_count); + if (tptime && tptime != -1) + eDVBLocalTimeHandler::getInstance()->updateTime(tptime, chan, update_count); error=0; return 1; } diff --git a/lib/dvb/esection.cpp b/lib/dvb/esection.cpp index ae88d100..4758008a 100644 --- a/lib/dvb/esection.cpp +++ b/lib/dvb/esection.cpp @@ -23,8 +23,11 @@ void eGTable::sectionRead(const __u8 *d) { if (m_timeout) m_timeout->stop(); - m_reader->stop(); - m_reader=0; + if (m_reader) + { + m_reader->stop(); + m_reader=0; + } m_sectionRead_conn=0; ready = 1; tableReady(error); @@ -35,8 +38,11 @@ void eGTable::sectionRead(const __u8 *d) void eGTable::timeout() { eDebug("timeout!"); - m_reader->stop(); - m_reader=0; + if (m_reader) + { + m_reader->stop(); + m_reader=0; + } m_sectionRead_conn=0; ready = 1; error = -1; -- 2.30.2