mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-29 14:30:27 +00:00
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
This commit is contained in:
parent
ada4e362b9
commit
2b83e8b700
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user