Skip to content

Commit

Permalink
Prevent calling init_vlc() with invalid parameters in motionpixels de…
Browse files Browse the repository at this point in the history
…coder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
Laurent Aimar authored and michaelni committed Sep 29, 2011
1 parent 56ee5a9 commit 41b7389
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavcodec/motionpixels.c
Expand Up @@ -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);
Expand Down

0 comments on commit 41b7389

Please sign in to comment.