aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg4video_parser.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-01-06 00:17:37 +0100
committerJanne Grunau <janne-libav@jannau.net>2012-01-06 01:47:45 +0100
commitf907615f0813e8499f06a7eebccf1c63fce87c8e (patch)
tree01382964311578995424eaaa0e4b6c1bc9bcf2e6 /libavcodec/mpeg4video_parser.c
parent580bb779360e9832e3b5581e349f76bca75ada08 (diff)
downloadffmpeg-f907615f0813e8499f06a7eebccf1c63fce87c8e.tar.gz
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/mpeg4video_parser.c')
-rw-r--r--libavcodec/mpeg4video_parser.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 162bc1d03e..89bbf3465d 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -99,6 +99,7 @@ static av_cold int mpeg4video_parse_init(AVCodecParserContext *s)
if (!pc->enc)
return -1;
pc->first_picture = 1;
+ pc->enc->slice_context_count = 1;
return 0;
}