Prevent negation of INT_MIN in pcmLimiter_Apply().

Bug: 145668877
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I734f839818f7130615a4438b8831ac664206cc34
This commit is contained in:
Fraunhofer IIS FDK 2019-10-29 13:09:23 +01:00 committed by Jean-Michel Trivi
parent 801b45ffab
commit 3700d4ff8f
1 changed files with 3 additions and 3 deletions

View File

@ -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);