Mercurial > libavcodec.hg
changeset 8022:21c3e313709e libavcodec
vp6dec: ensure we don't try to use a buffer with negative size
this should never happen in valid vp6 bitstream
fix issue684
author | aurel |
---|---|
date | Mon, 13 Oct 2008 00:10:53 +0000 |
parents | 00fca5d6f0d9 |
children | 76f6a08c9fe6 |
files | vp6.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/vp6.c Sun Oct 12 20:22:55 2008 +0000 +++ b/vp6.c Mon Oct 13 00:10:53 2008 +0000 @@ -135,6 +135,8 @@ 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);