aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-05-02 00:51:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-10-21 22:19:37 +0200
commitcc77089393974438eab9a24a1e939a9fea2359f5 (patch)
treec952461d82894b6aaa6aab4ea1ef61732ef7cfdf /libavcodec
parenteedbc82ea9442f0fc159a2efa27917f0d4b79922 (diff)
downloadffmpeg-cc77089393974438eab9a24a1e939a9fea2359f5.tar.gz
avcodec/sbrdsp_fixed: Fix integer overflows in sbr_qmf_deint_neg_c()
Fixes: signed integer overflow: 2147483645 + 16 cannot be represented in type 'int' Fixes: 46993/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-4759025234870272 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 1537f40516d625fc5fa57db4fdfb737312fbc500) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/sbrdsp_fixed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/sbrdsp_fixed.c b/libavcodec/sbrdsp_fixed.c
index 840cc7a0b0..f3e8d974a4 100644
--- a/libavcodec/sbrdsp_fixed.c
+++ b/libavcodec/sbrdsp_fixed.c
@@ -100,8 +100,8 @@ static void sbr_qmf_deint_neg_c(int *v, const int *src)
{
int i;
for (i = 0; i < 32; i++) {
- v[ i] = ( src[63 - 2*i ] + 0x10) >> 5;
- v[63 - i] = (-src[63 - 2*i - 1] + 0x10) >> 5;
+ v[ i] = (int)(0x10U + src[63 - 2*i ]) >> 5;
+ v[63 - i] = (int)(0x10U - src[63 - 2*i - 1]) >> 5;
}
}