diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-19 18:48:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:44 +0100 |
commit | 3ba76291044736167043373952487cabed18276b (patch) | |
tree | b617e8bf97159979eed84cebdd819bf2702a041a | |
parent | cf6f4e0d68302c4e3f3974849013d529bac1b775 (diff) | |
download | ffmpeg-3ba76291044736167043373952487cabed18276b.tar.gz |
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>
(cherry picked from commit 19b8db2908bf0fd248da1b2126e2592ade66c40c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/atrac9dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index f728f383d5..f89f24dfba 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -190,7 +190,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; } } |