summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2012-12-31 16:44:27 +0000
committerphintuka <phintuka>2012-12-31 16:44:27 +0000
commitce77c03ed8b315ed9922e870882fb5ad1a0b296f (patch)
tree62ca15c79d46b049a3b11d00244585c6cc0fef35
parentcd2a325e0cf736e489236ed5e8b4ab1a128fb547 (diff)
downloadxineliboutput-ce77c03ed8b315ed9922e870882fb5ad1a0b296f.tar.gz
xineliboutput-ce77c03ed8b315ed9922e870882fb5ad1a0b296f.tar.bz2
Fixed segfault in PMT parsing when first ts packet of pmt section has been lost
-rw-r--r--tools/ts.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/ts.c b/tools/ts.c
index 0f5c835c..0122e2e9 100644
--- a/tools/ts.c
+++ b/tools/ts.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: ts.c,v 1.29 2011-11-13 09:45:01 phintuka Exp $
+ * $Id: ts.c,v 1.30 2012-12-31 16:44:27 phintuka Exp $
*
*/
@@ -321,6 +321,11 @@ int ts_parse_pmt (pmt_data_t *pmt, uint program_no, const uint8_t *pkt)
}
}
+ if (!pmt->pmt) {
+ LOGMSG("parse_pmt: dropping PMT packet without PUSI");
+ return 0;
+ }
+
if (!pusi) {
section_length = (pmt->pmt[1] << 8 | pmt->pmt[2]) & 0x03ff;
version_number = (pkt[10] >> 1) & 0x1f;