summaryrefslogtreecommitdiff
path: root/libavcodec/vp6.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-05 16:01:51 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-05 16:01:51 +0000
commitad9210869459cede35baabbe20820b80e666c358 (patch)
treefc95f7323c20a8b24a1142808147dbe3c808934b /libavcodec/vp6.c
parent7576516a7edfa5227cc0d82950afc027b819cdb5 (diff)
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
Diffstat (limited to 'libavcodec/vp6.c')
-rw-r--r--libavcodec/vp6.c2
1 files changed, 2 insertions, 0 deletions
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) {