aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-11-11 13:03:27 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-11-11 13:03:27 +0000
commitf2c252729bc66c6bef041632a63ee279c9e7ca09 (patch)
tree600db2cceed1c6fffd057f37bba63a75f313e843
parent16ae37c1e32b57588f090039ca7248f49c7b2d17 (diff)
parentf6646105b9b8d9b5912f606da818d614b3171f78 (diff)
downloadlibopus-android12-mainline-networkstack-release.tar.gz
Change-Id: I59f1fdf3396c47e25faf8e78985dd204e68436bd
-rw-r--r--src/analysis.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/analysis.c b/src/analysis.c
index 058328f0..8b4f22d0 100644
--- a/src/analysis.c
+++ b/src/analysis.c
@@ -149,7 +149,10 @@ static opus_val32 silk_resampler_down2_hp(
out32_hp = ADD32( out32_hp, X );
S[ 2 ] = ADD32( -in32, X );
- hp_ener += out32_hp*(opus_val64)out32_hp;
+ if(__builtin_add_overflow(hp_ener, out32_hp*(opus_val64)out32_hp, &hp_ener))
+ {
+ hp_ener = UINT64_MAX;
+ }
/* Add, convert back to int16 and store to output */
out[ k ] = HALF32(out32);
}