diff vp6.c @ 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 544da38cb2c9
children 524cb7f5ad2b
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);