mirror of https://git.ffmpeg.org/ffmpeg.git
motionpixels: clip VLC codes.
Fixes invalid reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
This commit is contained in:
parent
8b516f154a
commit
ca41c72c6d
|
@ -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…
Reference in New Issue