From 1cd0a5516396bd6fb54e4df1e7c88ed18416299b Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Thu, 29 Sep 2011 03:12:07 +0000 Subject: [PATCH] motionpixels: Prevent calling init_vlc() with invalid parameters Signed-off-by: Janne Grunau --- libavcodec/motionpixels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 1564ea1151..d054e00342 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -281,6 +281,8 @@ static int mp_decode_frame(AVCodecContext *avctx, if (sz == 0) goto end; + if (mp->max_codes_bits <= 0) + goto end; if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0)) goto end; mp_decode_frame_helper(mp, &gb);