Commit be098f62 authored by Peter Ross's avatar Peter Ross Committed by Michael Niedermayer

avformat/wtvdec: ignore mpeg2 extradata

Files produced by windows media center contain meaningless mpeg1 sequence
header. The mpeg2 decoder detects the presence mpeg1 sequence header start
codes and attempts to decode the stream as mpeg1. (This problem introduced
in 73a2d16b.)

Fixes ticket #3601.
Signed-off-by: 's avatarPeter Ross <pross@xvid.org>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 58f4d126
......@@ -694,19 +694,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
avio_skip(pb, FFMAX(size - consumed, 0));
} else if (!ff_guidcmp(formattype, ff_format_mpeg2_video)) {
uint64_t consumed = parse_videoinfoheader2(s, st);
if (size - consumed >= 20) {
uint32_t count;
consumed += 20;
avio_skip(pb, 4);
count = avio_rl32(pb);
count = FFMIN(count, size - consumed);
avio_skip(pb, 12);
if (count && ff_get_extradata(st->codec, pb, count) < 0) {
ff_free_stream(s, st);
return NULL;
}
consumed += count;
}
/* ignore extradata; files produced by windows media center contain meaningless mpeg1 sequence header */
avio_skip(pb, FFMAX(size - consumed, 0));
} else {
if (ff_guidcmp(formattype, ff_format_none))
......
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