aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-29 03:12:07 +0000
committerJanne Grunau <janne-libav@jannau.net>2011-10-07 16:25:32 +0200
commit1cd0a5516396bd6fb54e4df1e7c88ed18416299b (patch)
tree65e5d204031991a58ec034de03cef195f66ca76c
parent5f05cf4ea9aaafed8edcabe785c2719786103ec1 (diff)
downloadffmpeg-1cd0a5516396bd6fb54e4df1e7c88ed18416299b.tar.gz
motionpixels: Prevent calling init_vlc() with invalid parameters
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
-rw-r--r--libavcodec/motionpixels.c2
1 files changed, 2 insertions, 0 deletions
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);