From f907615f0813e8499f06a7eebccf1c63fce87c8e Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 6 Jan 2012 00:17:37 +0100 Subject: 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. --- libavcodec/h264_parser.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libavcodec/h264_parser.c') diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 826c17a0f1..bcaa04a115 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -330,6 +330,7 @@ static int init(AVCodecParserContext *s) { H264Context *h = s->priv_data; h->thread_context[0] = h; + h->s.slice_context_count = 1; return 0; } -- cgit v1.2.3