summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-04-29 00:12:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-04-29 00:12:49 +0000
commitb22d0c04d76a5a3391051f0a7d573d8f9bdef4b3 (patch)
tree905f0dfda34cdc3a8338131dff5763ce9b1d1ce4 /libavformat/mpeg.c
parent60711e959992dbb37a4aea57b77976eee4a8efd4 (diff)
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
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 462ef73bc4..480c0541ca 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -341,12 +341,13 @@ static int mpegps_read_pes_header(AVFormatContext *s,
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;