diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-10-29 13:09:23 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-12-27 10:21:33 -0800 |
commit | 3700d4ff8fac723f4051a9d53dedae26393a2013 (patch) | |
tree | 35ca52ba847856493033e8d6037fa400b3d6efb7 /libPCMutils | |
parent | 801b45ffab8c3ac50c620fd5c6a5818782d2f889 (diff) | |
download | fdk-aac-3700d4ff8fac723f4051a9d53dedae26393a2013.tar.gz fdk-aac-3700d4ff8fac723f4051a9d53dedae26393a2013.tar.bz2 fdk-aac-3700d4ff8fac723f4051a9d53dedae26393a2013.zip |
Prevent negation of INT_MIN in pcmLimiter_Apply().
Bug: 145668877
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I734f839818f7130615a4438b8831ac664206cc34
Diffstat (limited to 'libPCMutils')
-rw-r--r-- | libPCMutils/src/limiter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libPCMutils/src/limiter.cpp b/libPCMutils/src/limiter.cpp index a799a51..60e3e3b 100644 --- a/libPCMutils/src/limiter.cpp +++ b/libPCMutils/src/limiter.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -239,8 +239,8 @@ TDLIMITER_ERROR pcmLimiter_Apply(TDLimiterPtr limiter, PCM_LIM* samplesIn, tmp1 = (FIXP_DBL)0; for (j = 0; j < channels; j++) { tmp2 = PCM_LIM2FIXP_DBL(samplesIn[j]); - tmp2 = fAbs(tmp2); - tmp2 = FIXP_DBL(INT(tmp2) ^ INT((tmp2 >> (SAMPLE_BITS_LIM - 1)))); + tmp2 = + (tmp2 == (FIXP_DBL)MINVAL_DBL) ? (FIXP_DBL)MAXVAL_DBL : fAbs(tmp2); tmp1 = fMax(tmp1, tmp2); } tmp = fMult(tmp1, additionalGain); |