smacker: more complete vlc length check, fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-30 16:00:07 +01:00
parent 50cbe09d8c
commit 2c69fcc2ff
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ enum SmkBlockTypes {
*/
static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t prefix, int length)
{
if(length > 32) {
if(length > 32 || length > 3*SMKTREE_BITS) {
av_log(NULL, AV_LOG_ERROR, "length too long\n");
return AVERROR_INVALIDDATA;
}