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: Michael Niedermayer <michael@niedermayer.cc>
pull/333/head
Michael Niedermayer 5 years ago
parent dbc50f8a93
commit 19b8db2908
  1. 2
      libavcodec/atrac9dec.c

@ -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;
}
}

Loading…
Cancel
Save