Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-23 00:19:52 +0400
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-23 19:46:25 +0400
commit2b83e8b7005d531bc78b0fd4f699e9faa54ce9bb (patch)
treeb5d751b63bed5c490fcad2de33f465aeeef8c862 /libavcodec/truemotion2.c
parentada4e362b9fa8cef033afb040f99b07069a7a5ee (diff)
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
Diffstat (limited to 'libavcodec/truemotion2.c')
-rw-r--r--libavcodec/truemotion2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 9e45045342..7be148c602 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;
}