aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/dvb.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2008-11-17 17:19:06 +0100
committerFelix Domke <tmbinc@elitedvb.net>2008-11-17 17:19:06 +0100
commita9efd192b545113282c7c7891a231570f49f27e6 (patch)
treef5168d04b5d0e4c64a0c4225672feb4bd3ccd338 /lib/dvb/dvb.cpp
parenta34ef895210161a8820e96829ac87806566e7858 (diff)
downloadenigma2-a9efd192b545113282c7c7891a231570f49f27e6.tar.gz
enigma2-a9efd192b545113282c7c7891a231570f49f27e6.zip
fix comment, don't memmem over end of packet
Diffstat (limited to 'lib/dvb/dvb.cpp')
-rw-r--r--lib/dvb/dvb.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index 3ad086de..07cc611b 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -973,7 +973,7 @@ int eDVBChannelFilePush::filterRecordData(const unsigned char *_data, int len, s
}
#endif
-#if 1 /* not yet */
+#if 1 /* This codepath is required on Broadcom-based Dreamboxes (DM800, DM8000) and strips away non-I-frames. */
if (!m_iframe_search)
return len;
@@ -982,7 +982,7 @@ int eDVBChannelFilePush::filterRecordData(const unsigned char *_data, int len, s
// eDebug("filterRecordData, size=%d (mod 188=%d), first byte is %02x", len, len %188, data[0]);
unsigned char *d = data;
- while ((d = (unsigned char*)memmem(d, data + len - d, "\x00\x00\x01", 3)))
+ while ((d + 3 < data + len) && (d = (unsigned char*)memmem(d, data + len - d, "\x00\x00\x01", 3)))
{
int offset = d - data;
int ts_offset = offset - offset % 188; /* offset to the start of TS packet */
@@ -1054,7 +1054,6 @@ int eDVBChannelFilePush::filterRecordData(const unsigned char *_data, int len, s
d += 4;
} else
d += 4; /* ignore */
-
}
if (m_iframe_state == 1)