aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-12 17:11:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:37:21 +0200
commit92b8c0a8c102a25cc117b9853ced649c709c3a8d (patch)
treeb8f3983a5bb7dfa8b8257b298cfc707df8ff816d
parent75ce842d7c3de47ffbe86b3c1f6c1cbc912daf14 (diff)
downloadffmpeg-92b8c0a8c102a25cc117b9853ced649c709c3a8d.tar.gz
avcodec/aacdec_fixed: Limit index in vector_pow43()
Fixes: out of array access Fixes: 26087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5724825462767616 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4f83a536384afda45acb6d7cdd22017c8c314f9e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aacdec_fixed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 411d96d5a6..e0fe504b8e 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -155,9 +155,9 @@ static void vector_pow43(int *coefs, int len)
for (i=0; i<len; i++) {
coef = coefs[i];
if (coef < 0)
- coef = -(int)ff_cbrt_tab_fixed[-coef];
+ coef = -(int)ff_cbrt_tab_fixed[(-coef) & 8191];
else
- coef = (int)ff_cbrt_tab_fixed[coef];
+ coef = (int)ff_cbrt_tab_fixed[ coef & 8191];
coefs[i] = coef;
}
}