[FFmpeg-cvslog] avcodec/smacker: use the correct field instead of a hardcoded value for the index check in smacker_decode_tree ()

Michael Niedermayer git at videolan.org
Thu Sep 12 16:24:36 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 12 15:31:12 2013 +0200| [59a08d193963ba3455b8c8b8a7b1b620e13b8e8f] | committer: Michael Niedermayer

avcodec/smacker: use the correct field instead of a hardcoded value for the index check in smacker_decode_tree()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59a08d193963ba3455b8c8b8a7b1b620e13b8e8f
---

 libavcodec/smacker.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 899ba23..b5712a6 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;
         }



More information about the ffmpeg-cvslog mailing list