summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-29 01:04:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-29 06:11:18 +0200
commit41b7389cade702383e59343561776f83bb26e17f (patch)
treee08963e931a5f9a764c5d981113d6e6fdb20e3ed /libavcodec
parent56ee5a9ad1b385129c40ba4773f99bc5943ae8af (diff)
downloadffmpeg-41b7389cade702383e59343561776f83bb26e17f.tar.gz
Prevent calling init_vlc() with invalid parameters in motionpixels decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/motionpixels.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 160508007d..165a3d1667 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -279,6 +279,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);