aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-29 01:04:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-01 20:51:17 +0200
commitf8eabfc16ed260ae33bd2c15c240eaf2129dba47 (patch)
treeaa971d5569cfd75a1a01d7e373e6ba7b172c293f
parent14617fa7b8e688f5688d3679c906c8cb75ff42ed (diff)
downloadffmpeg-f8eabfc16ed260ae33bd2c15c240eaf2129dba47.tar.gz
Prevent calling init_vlc() with invalid parameters in motionpixels decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 41b7389cade702383e59343561776f83bb26e17f)
-rw-r--r--libavcodec/motionpixels.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index b18efa6b9c..4bd83cb2ae 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);