diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-21 16:01:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-21 19:49:37 +0200 |
commit | b829da363985cb2f80130bba304cc29a632f6446 (patch) | |
tree | 8dfa544c8b7f37b043a9835bab958652e338206b | |
parent | 7681d0eaca39eacea4cb573c737f6c5f0190307c (diff) | |
download | ffmpeg-b829da363985cb2f80130bba304cc29a632f6446.tar.gz |
smacker: add sanity check for length in smacker_decode_tree()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/smacker.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index c1775103e8..017942063e 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -96,6 +96,10 @@ enum SmkBlockTypes { */ static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t prefix, int length) { + if(length > 32) { + av_log(NULL, AV_LOG_ERROR, "length too long\n"); + return -1; + } if(!get_bits1(gb)){ //Leaf if(hc->current >= 256){ av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n"); |