summaryrefslogtreecommitdiff
path: root/libavformat/wtvdec.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2014-05-01 22:22:09 +1000
committerMichael Niedermayer <michaelni@gmx.at>2014-05-01 18:36:27 +0200
commitbe098f6237980292c7f5c640aae638efd9e6cb11 (patch)
treeca8a9f71ce63d38c0a7b38263d69af2a52fd6415 /libavformat/wtvdec.c
parent58f4d1266bce51f3b14d6d775ebf88bdcef33ef8 (diff)
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: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r--libavformat/wtvdec.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 597a11fbd4..cfdc55523a 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -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))