Mercurial > libavformat.hg
changeset 3270:567f8a365db0 libavformat
Support invalid mpeg created by vdr
(http://www.lucke.in-berlin.de/test_streams/last_played_fine_with_r7852_001.vdr).
fixes issue434
author | michael |
---|---|
date | Tue, 29 Apr 2008 00:12:49 +0000 |
parents | 55d4f01c9728 |
children | c702c1c5b890 |
files | mpeg.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mpeg.c Mon Apr 28 18:29:42 2008 +0000 +++ b/mpeg.c Tue Apr 29 00:12:49 2008 +0000 @@ -341,12 +341,13 @@ if (flags & 0x01) { /* PES extension */ pes_ext = get_byte(s->pb); header_len--; - if (pes_ext & 0x40) { /* pack header - should be zero in PS */ - goto error_redo; - } /* Skip PES private data, program packet sequence counter and P-STD buffer */ skip = (pes_ext >> 4) & 0xb; skip += skip & 0x9; + if (pes_ext & 0x40 || skip > header_len){ + av_log(s, AV_LOG_WARNING, "pes_ext %X is invalid\n", pes_ext); + pes_ext=skip=0; + } url_fskip(s->pb, skip); header_len -= skip;