smacker: fix an off by one in huff.length computation
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 12 Jun 2013 12:22:24 +0000 (14:22 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 16 Jun 2013 13:55:53 +0000 (15:55 +0200)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/smacker.c

index a89cbd3..ca9194f 100644 (file)
@@ -246,7 +246,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
     ctx.recode2 = tmp2.values;
     ctx.last = last;
 
-    huff.length = ((size + 3) >> 2) + 3;
+    huff.length = ((size + 3) >> 2) + 4;
     huff.maxlength = 0;
     huff.current = 0;
     huff.values = av_mallocz(huff.length * sizeof(int));