From ad9210869459cede35baabbe20820b80e666c358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 5 Jul 2009 16:01:51 +0000 Subject: [PATCH] Add a check to vp6_parse_coeff_huffman to ensure it does not overread the input buffer. Originally committed as revision 19349 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/vp6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index c1ca2273b1..de98e61e6e 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -372,6 +372,8 @@ static void vp6_parse_coeff_huffman(VP56Context *s) if (coeff_idx) break; } else { + if (get_bits_count(&s->gb) >= s->gb.size_in_bits) + return; coeff = get_vlc2(&s->gb, vlc_coeff->table, 9, 3); if (coeff == 0) { if (coeff_idx) { -- GitLab