Commit 19b8db29 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/atrac9dec: Check precision_fine/coarse

Clipping is done as it was preferred in review
See: [FFmpeg-devel] [PATCH 1/5] avcodec/atrac9dec: Check precision_fine/coarse

Fixes: out of array access
Fixes: 18330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5641113058148352
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent dbc50f8a
......@@ -187,7 +187,7 @@ static inline void calc_precision(ATRAC9Context *s, ATRAC9BlockData *b,
for (int i = 0; i < b->q_unit_cnt; i++) {
c->precision_fine[i] = 0;
if (c->precision_coarse[i] > 15) {
c->precision_fine[i] = c->precision_coarse[i] - 15;
c->precision_fine[i] = FFMIN(c->precision_coarse[i], 30) - 15;
c->precision_coarse[i] = 15;
}
}
......
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