summaryrefslogtreecommitdiff
path: root/libavcodec/smacker.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-12 12:45:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-12 12:51:07 +0200
commitf8932d990228c53ee498b17eadf9dae4755c87ab (patch)
tree90b8a19ca865a5883465c76d9e18f98c3f747bc6 /libavcodec/smacker.c
parentd510d70df02b3769a184daa355a461d9c9f51e18 (diff)
parent0679cec6e8802643bbe6d5f68ca1110a7d3171da (diff)
downloadffmpeg-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>
Diffstat (limited to 'libavcodec/smacker.c')
-rw-r--r--libavcodec/smacker.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 1c021ac5fa..6fe2cc97f6 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;