diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-10-13 00:10:53 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-10-13 00:10:53 +0000 |
commit | 40056c32df9fb6db2774dcc0d4f87cbfd759058e (patch) | |
tree | 9fa08644447877371c497f60852a210c4504ed98 /libavcodec/vp6.c | |
parent | f2e49553de52d694f9207c877e85f95dfe7bb4e7 (diff) | |
download | ffmpeg-40056c32df9fb6db2774dcc0d4f87cbfd759058e.tar.gz |
vp6dec: ensure we don't try to use a buffer with negative size
this should never happen in valid vp6 bitstream
fix issue684
Originally committed as revision 15610 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp6.c')
-rw-r--r-- | libavcodec/vp6.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index c1cd6fe64b..bea7c9ed02 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -135,6 +135,8 @@ static int vp6_parse_header(vp56_context_t *s, const uint8_t *buf, int buf_size, if (coeff_offset) { buf += coeff_offset; buf_size -= coeff_offset; + if (buf_size < 0) + return 0; if (s->use_huffman) { s->parse_coeff = vp6_parse_coeff_huffman; init_get_bits(&s->gb, buf, buf_size<<3); |