Merge "Integer overflow fix in _compressorIO_sigmoid()"
am: 7c908b13b9

Change-Id: I8265838085c3db1931a4ccb614ec7e4cdcca63e5
diff --git a/libDRCdec/src/drcGainDec_preprocess.cpp b/libDRCdec/src/drcGainDec_preprocess.cpp
index 7919589..c543c53 100644
--- a/libDRCdec/src/drcGainDec_preprocess.cpp
+++ b/libDRCdec/src/drcGainDec_preprocess.cpp
@@ -300,8 +300,9 @@
   FIXP_SGL exp = pCChar->exp;
   DRC_ERROR err = DE_OK;
 
-  tmp = fMultDiv2(DRC_INPUT_LOUDNESS_TARGET - inLevelDb, pCChar->ioRatio);
-  tmp = SATURATE_LEFT_SHIFT(tmp, 2 + 1, DFRACT_BITS);
+  tmp = fMultDiv2((DRC_INPUT_LOUDNESS_TARGET >> 1) - (inLevelDb >> 1),
+                  pCChar->ioRatio);
+  tmp = SATURATE_LEFT_SHIFT(tmp, 2 + 1 + 1, DFRACT_BITS);
   if (exp < (FIXP_SGL)MAXVAL_SGL) {
     /* x = tmp / gainDbLimit; */
     /* *outGainDb = tmp / pow(1.0f + pow(x, exp), 1.0f/exp); */