diff options
| author | phintuka <phintuka> | 2012-08-30 08:25:47 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2012-08-30 08:25:47 +0000 |
| commit | 8e150fb67aa2f51c24796ebc7782b4a642bd6307 (patch) | |
| tree | c65c8c4cec51b75570fa7fce2808aa49e7cc71af | |
| parent | d32026b4e5df2382fc84722fb7c4719c463d8f19 (diff) | |
| download | xineliboutput-8e150fb67aa2f51c24796ebc7782b4a642bd6307.tar.gz xineliboutput-8e150fb67aa2f51c24796ebc7782b4a642bd6307.tar.bz2 | |
mpeeg-ts demuxer: added PES header parsing sanity check
| -rw-r--r-- | xine/ts2es.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xine/ts2es.c b/xine/ts2es.c index d98cbd2b..c82c8836 100644 --- a/xine/ts2es.c +++ b/xine/ts2es.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: ts2es.c,v 1.15 2012-01-16 13:26:14 phintuka Exp $ + * $Id: ts2es.c,v 1.16 2012-08-30 08:25:47 phintuka Exp $ * */ @@ -48,6 +48,13 @@ static void ts2es_parse_pes(ts2es_t *this) uint8_t pes_pid = this->buf->content[3]; uint pes_len = (this->buf->content[4] << 8) | this->buf->content[5]; + /* Check if header is complete */ + if (this->buf->size < 9 || this->buf->size < hdr_len) { + LOGMSG("ts2es: PES header not in first TS fragment"); + this->pes_error = 1; + return; + } + /* parse PTS */ this->buf->pts = pes_get_pts(this->buf->content, this->buf->size); if (this->buf->pts <= 0) |
