diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-12 12:45:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-12 12:51:07 +0200 |
commit | f8932d990228c53ee498b17eadf9dae4755c87ab (patch) | |
tree | 90b8a19ca865a5883465c76d9e18f98c3f747bc6 | |
parent | d510d70df02b3769a184daa355a461d9c9f51e18 (diff) | |
parent | 0679cec6e8802643bbe6d5f68ca1110a7d3171da (diff) | |
download | ffmpeg-streaming-f8932d990228c53ee498b17eadf9dae4755c87ab.zip ffmpeg-streaming-f8932d990228c53ee498b17eadf9dae4755c87ab.tar.gz |
Merge commit '0679cec6e8802643bbe6d5f68ca1110a7d3171da'
* commit '0679cec6e8802643bbe6d5f68ca1110a7d3171da':
smacker: Make sure we don't fill in huffman codes out of range
Conflicts:
libavcodec/smacker.c
See: 1285baaab550e3e761590ef6dfb1d9bd9d1332e4
the added test is redundant but will be used after future refactoring
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/smacker.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 1c021ac..6fe2cc9 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -284,6 +284,12 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int av_log(smk->avctx, AV_LOG_ERROR, "bigtree damaged\n"); return AVERROR_INVALIDDATA; } + if (ctx.last[0] >= huff.length || + ctx.last[1] >= huff.length || + ctx.last[2] >= huff.length) { + av_log(smk->avctx, AV_LOG_ERROR, "Huffman codes out of range\n"); + err = AVERROR_INVALIDDATA; + } *recodes = huff.values; |