summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-05-21 10:03:48 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-05-21 10:03:48 +0200
commit85af76ab639c7771dcadf05ad8ae3dccca760e09 (patch)
tree76ebab7a7ae3915d4f6e765a677cdb881e5dc108
parentee382b4ad2d815384e57edd418b8e31f74287e76 (diff)
downloadvdr-85af76ab639c7771dcadf05ad8ae3dccca760e09.tar.gz
vdr-85af76ab639c7771dcadf05ad8ae3dccca760e09.tar.bz2
TsGetPayload() now checks if there actually is a payload in the given TS packet
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY2
-rw-r--r--remux.h13
3 files changed, 12 insertions, 5 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index e469c169..44c3de3b 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2702,3 +2702,5 @@ Mika Laitio <lamikr@pilppa.org>
Dirk Leber <dirk.leber@reel-multimedia.com>
for fixing cString's operator=(const char *String) in case the given string is the
same as the existing one
+ for reporting that TsGetPayload() gets called without checking whether there actually
+ is a payload in the given TS packet
diff --git a/HISTORY b/HISTORY
index 69233209..1dca1626 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6612,3 +6612,5 @@ Video Disk Recorder Revision History
- Fixed cString's operator=(const char *String) in case the given string is the
same as the existing one (thanks to Dirk Leber).
- Avoiding a gcc 4.6 compiler error in the skincurses plugin (thanks to Tobias Grimm).
+- TsGetPayload() now checks if there actually is a payload in the given TS packet
+ (reported by Dirk Leber).
diff --git a/remux.h b/remux.h
index 60a9a578..0e060b7e 100644
--- a/remux.h
+++ b/remux.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remux.h 2.28 2011/03/19 16:52:46 kls Exp $
+ * $Id: remux.h 2.29 2011/05/21 09:53:54 kls Exp $
*/
#ifndef __REMUX_H
@@ -84,15 +84,18 @@ inline bool TsIsScrambled(const uchar *p)
inline int TsPayloadOffset(const uchar *p)
{
- int o = (p[3] & TS_ADAPT_FIELD_EXISTS) ? p[4] + 5 : 4;
+ int o = TsHasAdaptationField(p) ? p[4] + 5 : 4;
return o <= TS_SIZE ? o : TS_SIZE;
}
inline int TsGetPayload(const uchar **p)
{
- int o = TsPayloadOffset(*p);
- *p += o;
- return TS_SIZE - o;
+ if (TsHasPayload(*p)) {
+ int o = TsPayloadOffset(*p);
+ *p += o;
+ return TS_SIZE - o;
+ }
+ return 0;
}
inline int TsContinuityCounter(const uchar *p)