From 3700d4ff8fac723f4051a9d53dedae26393a2013 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 29 Oct 2019 13:09:23 +0100 Subject: Prevent negation of INT_MIN in pcmLimiter_Apply(). Bug: 145668877 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I734f839818f7130615a4438b8831ac664206cc34 --- libPCMutils/src/limiter.cpp | 6 +++--- 1 file 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); -- cgit v1.2.3