[libav-stable] smacker: fix an off by one in huff.length computation

Kostya Shishkov git at libav.org
Sun Jun 16 15:57:52 CEST 2013


Module: libav
Branch: master
Commit: f52edef30197735bfb937e9e723ab1e7b31165c6

Author:    Kostya Shishkov <kostya.shishkov at gmail.com>
Committer: Luca Barbato <lu_zero at gentoo.org>
Date:      Wed Jun 12 14:22:24 2013 +0200

smacker: fix an off by one in huff.length computation

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

---

 libavcodec/smacker.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index a89cbd3..ca9194f 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -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));



More information about the libav-stable mailing list