Browse Source

motionpixels: clip VLC codes.

Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
tags/n2.2-rc1
Anton Khirnov 12 years ago
parent
commit
ca41c72c6d
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/motionpixels.c

+ 1
- 0
libavcodec/motionpixels.c View File

@@ -180,6 +180,7 @@ static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb)
int i; int i;


i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1); i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1);
i = FFMIN(i, FF_ARRAY_ELEMS(mp->codes) - 1);
return mp->codes[i].delta; return mp->codes[i].delta;
} }




Loading…
Cancel
Save