summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@civ.zcu.cz>2010-11-30 23:16:23 +0100
committerFrantišek Dvořák <valtri@civ.zcu.cz>2010-11-30 23:16:23 +0100
commit4dd0040f8e622267e872ba425858babccdf27241 (patch)
treed6ebebd6eebc517083a08dca15df926791f80dd6 /src
parent74ed31516e0d2e1000d19ab2f97413e424453ae4 (diff)
downloadxine-lib-4dd0040f8e622267e872ba425858babccdf27241.tar.gz
xine-lib-4dd0040f8e622267e872ba425858babccdf27241.tar.bz2
Check boundaries during MPEG TS stream detection.
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_ts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 86e216304..f31578073 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -2360,18 +2360,20 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
demux_ts_t *this;
int i;
int hdmv = -1;
+ int size;
switch (stream->content_detection_method) {
case METHOD_BY_CONTENT: {
uint8_t buf[2069];
- if (!_x_demux_read_header(input, buf, sizeof(buf)))
+ size = _x_demux_read_header(input, buf, sizeof(buf));
+ if (size < PKT_SIZE)
return NULL;
if (detect_ts(buf, sizeof(buf), PKT_SIZE))
hdmv = 0;
- else if (detect_ts(buf, sizeof(buf), PKT_SIZE+4))
+ else if (size >= PKT_SIZE + 4 && detect_ts(buf, sizeof(buf), PKT_SIZE+4))
hdmv = 1;
else
return NULL;