diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-01-06 03:17:37 +0400 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-01-06 04:47:45 +0400 |
commit | f907615f0813e8499f06a7eebccf1c63fce87c8e (patch) | |
tree | 01382964311578995424eaaa0e4b6c1bc9bcf2e6 /libavcodec/vc1_parser.c | |
parent | 580bb779360e9832e3b5581e349f76bca75ada08 (diff) |
parsers: initialize MpegEncContext.slice_context_count to 1
The mpeg4 video, H264 and VC-1 parser hold (directly or indirectly)
a MpegEncContext in their private context. Since they do not call the
common mpegvideo init function slice_context_count has explicitly set
to 1.
Prevents a null pointer dereference in the h264 parser and fixes
bug 193.
Diffstat (limited to 'libavcodec/vc1_parser.c')
-rw-r--r-- | libavcodec/vc1_parser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c index e6243d9ac0..0cc5ea0fa8 100644 --- a/libavcodec/vc1_parser.c +++ b/libavcodec/vc1_parser.c @@ -184,9 +184,17 @@ static int vc1_split(AVCodecContext *avctx, return 0; } +static int vc1_parse_init(AVCodecParserContext *s) +{ + VC1ParseContext *vpc = s->priv_data; + vpc->v.s.slice_context_count = 1; + return 0; +} + AVCodecParser ff_vc1_parser = { .codec_ids = { CODEC_ID_VC1 }, .priv_data_size = sizeof(VC1ParseContext), + .parser_init = vc1_parse_init, .parser_parse = vc1_parse, .parser_close = ff_parse1_close, .split = vc1_split, |