From 59a08d193963ba3455b8c8b8a7b1b620e13b8e8f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 12 Sep 2013 15:31:12 +0200 Subject: [PATCH] avcodec/smacker: use the correct field instead of a hardcoded value for the index check in smacker_decode_tree() Signed-off-by: Michael Niedermayer --- libavcodec/smacker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 899ba23e90..b5712a6ea5 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -102,7 +102,7 @@ static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t pref return AVERROR_INVALIDDATA; } if(!get_bits1(gb)){ //Leaf - if(hc->current >= 256){ + if(hc->current >= hc->length){ av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n"); return AVERROR_INVALIDDATA; }