diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-09-06 13:34:42 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-09-06 13:34:42 -0700 |
commit | 983a134adb0035a856d578e69d0c25c301c312f9 (patch) | |
tree | ea6ee2c2d059aed2f8bff5e71639c1357e5ac9bc | |
parent | b5a223ae08701b07c399399d670e28244d2f0703 (diff) | |
parent | 646ead1a65b7efa806e4e3b7179bdd11088a8b73 (diff) | |
download | fdk-aac-983a134adb0035a856d578e69d0c25c301c312f9.tar.gz fdk-aac-983a134adb0035a856d578e69d0c25c301c312f9.tar.bz2 fdk-aac-983a134adb0035a856d578e69d0c25c301c312f9.zip |
Merge "Prevent overflow in concealment clipping check" into pi-dev am: b3ea08e059
am: 646ead1a65
Change-Id: I76943ca6e6c4541924c34ce6e7da5bf95676abec
-rw-r--r-- | libAACdec/src/conceal.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libAACdec/src/conceal.cpp b/libAACdec/src/conceal.cpp index a6064b6..569d672 100644 --- a/libAACdec/src/conceal.cpp +++ b/libAACdec/src/conceal.cpp @@ -2080,11 +2080,11 @@ static void CConcealment_TDNoise_Apply(CConcealmentInfo *const pConcealmentInfo, noiseVal = FX_DBL2FX_PCM(fMult(noiseValLong, TDNoiseAtt)); /* add filtered noise - check for clipping, before */ - if (pcmdata[ii] > (FIXP_PCM)MAXVAL_FIXP_PCM - noiseVal && - noiseVal > (FIXP_PCM)0) { + if (noiseVal > (FIXP_PCM)0 && + pcmdata[ii] > (FIXP_PCM)MAXVAL_FIXP_PCM - noiseVal) { noiseVal = noiseVal * (FIXP_PCM)-1; - } else if (pcmdata[ii] < (FIXP_PCM)MINVAL_FIXP_PCM - noiseVal && - noiseVal < (FIXP_PCM)0) { + } else if (noiseVal < (FIXP_PCM)0 && + pcmdata[ii] < (FIXP_PCM)MINVAL_FIXP_PCM - noiseVal) { noiseVal = noiseVal * (FIXP_PCM)-1; } |