Module: libav Branch: release/9 Commit: 26221a54eca391de29557fc08c32d23a40ef4d32
Author: Anton Khirnov <[email protected]> Committer: Reinhard Tartler <[email protected]> Date: Fri Nov 15 15:33:20 2013 +0100 motionpixels: clip VLC codes. Fixes invalid reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:[email protected] (cherry picked from commit ca41c72c6d9515d9045bd3b68104525dee81b8d0) Signed-off-by: Reinhard Tartler <[email protected]> --- libavcodec/motionpixels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index c2bd0f4..4c0b98b 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -159,6 +159,7 @@ static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb) int i; 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; } _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
