aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-29 03:12:07 +0000
committerReinhard Tartler <siretart@tauware.de>2012-03-18 17:50:31 +0100
commit5fa8e43b547859fe0963c127e67832789564bf1e (patch)
tree613ea2eedd6f226547c164c288ba5347070c267d
parent737bea21b6c2c1d4dca0b7b18824c0a3205556d2 (diff)
downloadffmpeg-5fa8e43b547859fe0963c127e67832789564bf1e.tar.gz
motionpixels: Prevent calling init_vlc() with invalid parameters
Signed-off-by: Janne Grunau <janne-libav@jannau.net> (cherry picked from commit 1cd0a5516396bd6fb54e4df1e7c88ed18416299b) Signed-off-by: Anton Khirnov <anton@khirnov.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 cee21d3aa1..23433a1caf 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);