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.
This commit is contained in:
Janne Grunau
2012-01-06 00:17:37 +01:00
parent 580bb77936
commit f907615f08
3 changed files with 10 additions and 0 deletions

View File

@@ -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;
}