aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-07-22 00:44:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-07-26 00:14:04 +0200
commit91442fdc1c6e5276095d04e0a59f690b11af4029 (patch)
treee8262a50976bc7cd2588a638487dbb206eeb4bc6 /libavcodec
parent56e2ec0e9fea1f7673e97def41c0d4793a9489d6 (diff)
downloadffmpeg-91442fdc1c6e5276095d04e0a59f690b11af4029.tar.gz
avcodec/aacps: Fix multiple integer overflow in map_val_34_to_20()
Fixes: avcodec/aacps.c:511:40: runtime error: signed integer overflow: 1509077651 + 758068176 cannot be represented in type 'int' Fixes: 2678/clusterfuzz-testcase-minimized-4702787684270080 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 0764fe1d09833ae4dcf9e427df09378d0d6a3386) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c
index 8b2cb9f02c..aa0220b147 100644
--- a/libavcodec/aacps.c
+++ b/libavcodec/aacps.c
@@ -499,13 +499,13 @@ static void map_idx_34_to_20(int8_t *par_mapped, const int8_t *par, int full)
static void map_val_34_to_20(INTFLOAT par[PS_MAX_NR_IIDICC])
{
#if USE_FIXED
- par[ 0] = (int)(((int64_t)(par[ 0] + (par[ 1]>>1)) * 1431655765 + \
+ par[ 0] = (int)(((int64_t)(par[ 0] + (unsigned)(par[ 1]>>1)) * 1431655765 + \
0x40000000) >> 31);
- par[ 1] = (int)(((int64_t)((par[ 1]>>1) + par[ 2]) * 1431655765 + \
+ par[ 1] = (int)(((int64_t)((par[ 1]>>1) + (unsigned)par[ 2]) * 1431655765 + \
0x40000000) >> 31);
- par[ 2] = (int)(((int64_t)(par[ 3] + (par[ 4]>>1)) * 1431655765 + \
+ par[ 2] = (int)(((int64_t)(par[ 3] + (unsigned)(par[ 4]>>1)) * 1431655765 + \
0x40000000) >> 31);
- par[ 3] = (int)(((int64_t)((par[ 4]>>1) + par[ 5]) * 1431655765 + \
+ par[ 3] = (int)(((int64_t)((par[ 4]>>1) + (unsigned)par[ 5]) * 1431655765 + \
0x40000000) >> 31);
#else
par[ 0] = (2*par[ 0] + par[ 1]) * 0.33333333f;