[FFmpeg-cvslog] avcodec/atrac9dec: Check precision_fine/coarse
Michael Niedermayer
git at videolan.org
Wed Nov 20 16:52:39 EET 2019
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Oct 19 18:48:03 2019 +0200| [19b8db2908bf0fd248da1b2126e2592ade66c40c] | committer: 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: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19b8db2908bf0fd248da1b2126e2592ade66c40c
---
libavcodec/atrac9dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index b0f659d118..e3e4f2f14e 100644
--- a/libavcodec/atrac9dec.c
+++ b/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;
}
}
More information about the ffmpeg-cvslog
mailing list