avcodec/smacker: use the correct field instead of a hardcoded value for the index...
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Sep 2013 13:31:12 +0000 (15:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Sep 2013 14:17:32 +0000 (16:17 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/smacker.c

index 899ba23..b5712a6 100644 (file)
@@ -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;
         }