aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-22 12:19:52 -0800
committerReinhard Tartler <siretart@tauware.de>2012-04-01 18:33:26 +0200
commit18b2f23ef83cf317fcf0de6035878407ba68829c (patch)
treeba743f4ec925059420112ac0ab2471bb6af84362
parent33149928edef047fb6391cf8a84602a213c62921 (diff)
downloadffmpeg-18b2f23ef83cf317fcf0de6035878407ba68829c.tar.gz
truemotion2: error out if the huffman tree has no nodes.
This prevents crashers and errors further down when reading nodes in the empty tree. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 2b83e8b7005d531bc78b0fd4f699e9faa54ce9bb) Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/truemotion2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 23abade214..6ca97338e1 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -132,7 +132,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
huff.val_bits, huff.max_bits);
return -1;
}
- if((huff.nodes < 0) || (huff.nodes > 0x10000)) {
+ if((huff.nodes <= 0) || (huff.nodes > 0x10000)) {
av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of Huffman tree nodes: %i\n", huff.nodes);
return -1;
}