Commit 18f94df8 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/alsdec: check predictor order against block length

Fixes out of array access
Fixes: abd3c041acbcb816be113455d138166b-asan_heap-oob_b11634_3707_cov_1707137151_als_05_2ch48k16b.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ec482e73
...@@ -688,7 +688,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) ...@@ -688,7 +688,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
} else { } else {
*bd->opt_order = sconf->max_order; *bd->opt_order = sconf->max_order;
} }
if (*bd->opt_order > bd->block_length) {
*bd->opt_order = bd->block_length;
av_log(avctx, AV_LOG_ERROR, "Predictor order too large.\n");
return AVERROR_INVALIDDATA;
}
opt_order = *bd->opt_order; opt_order = *bd->opt_order;
if (opt_order) { if (opt_order) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment