[FFmpeg-devel] [PATCH 1/2] avformat/wtvdec: demux mpeg2 extradata

Peter Ross pross at xvid.org
Sun Mar 30 03:43:19 CEST 2014


Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavformat/wtvdec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 834198f..45e6b4a 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -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))
-- 
1.8.3.2

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140330/52ca93e8/attachment.asc>


More information about the ffmpeg-devel mailing list