Commit b22d0c04 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

Support invalid mpeg created by vdr

(http://www.lucke.in-berlin.de/test_streams/last_played_fine_with_r7852_001.vdr).
fixes issue434

Originally committed as revision 13014 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 60711e95
...@@ -341,12 +341,13 @@ static int mpegps_read_pes_header(AVFormatContext *s, ...@@ -341,12 +341,13 @@ static int mpegps_read_pes_header(AVFormatContext *s,
if (flags & 0x01) { /* PES extension */ if (flags & 0x01) { /* PES extension */
pes_ext = get_byte(s->pb); pes_ext = get_byte(s->pb);
header_len--; 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 private data, program packet sequence counter and P-STD buffer */
skip = (pes_ext >> 4) & 0xb; skip = (pes_ext >> 4) & 0xb;
skip += skip & 0x9; 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); url_fskip(s->pb, skip);
header_len -= skip; header_len -= skip;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment