Prevent calling init_vlc() with invalid parameters in motionpixels decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 41b7389cade702383e59343561776f83bb26e17f)
This commit is contained in:
Laurent Aimar 2011-09-29 01:04:52 +02:00 committed by Michael Niedermayer
parent 14617fa7b8
commit f8eabfc16e

View File

@ -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);