avformat/wtvdec: demux mpeg2 extradata
authorPeter Ross <pross@xvid.org>
Sun, 30 Mar 2014 01:43:19 +0000 (12:43 +1100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 30 Mar 2014 04:22:50 +0000 (06:22 +0200)
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/wtvdec.c

index 834198f..45e6b4a 100644 (file)
@@ -694,6 +694,15 @@ 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)) {
             int consumed = parse_videoinfoheader2(s, st);
+            int count;
+            avio_skip(pb, 4);
+            count = avio_rl32(pb);
+            avio_skip(pb, 12);
+            if (count && ff_get_extradata(st->codec, pb, count) < 0) {
+               ff_free_stream(s, st);
+               return NULL;
+            }
+            consumed += 20 + count;
             avio_skip(pb, FFMAX(size - consumed, 0));
         } else {
             if (ff_guidcmp(formattype, ff_format_none))