mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-06-05 22:39:13 +02:00
Avoid signed integer overflows in SpatialDecApplyParameterSets() when adding dry and wet signal.
Bug: 146936964 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: Idb4242d54b2e61805ab071a8977eed8f06081edf
This commit is contained in:
committed by
Jean-Michel Trivi
parent
76c229c018
commit
25fb9adf6f
@@ -1317,10 +1317,12 @@ static SACDEC_ERROR SpatialDecApplyParameterSets(
|
|||||||
if ((self->tempShapeConfig == 1) && (!isTwoChMode(self->upmixType))) {
|
if ((self->tempShapeConfig == 1) && (!isTwoChMode(self->upmixType))) {
|
||||||
for (ch = 0; ch < self->numOutputChannels; ch++) {
|
for (ch = 0; ch < self->numOutputChannels; ch++) {
|
||||||
for (hyb = 0; hyb < self->tp_hybBandBorder; hyb++) {
|
for (hyb = 0; hyb < self->tp_hybBandBorder; hyb++) {
|
||||||
self->hybOutputRealDry__FDK[ch][hyb] +=
|
self->hybOutputRealDry__FDK[ch][hyb] =
|
||||||
self->hybOutputRealWet__FDK[ch][hyb];
|
fAddSaturate(self->hybOutputRealDry__FDK[ch][hyb],
|
||||||
self->hybOutputImagDry__FDK[ch][hyb] +=
|
self->hybOutputRealWet__FDK[ch][hyb]);
|
||||||
self->hybOutputImagWet__FDK[ch][hyb];
|
self->hybOutputImagDry__FDK[ch][hyb] =
|
||||||
|
fAddSaturate(self->hybOutputImagDry__FDK[ch][hyb],
|
||||||
|
self->hybOutputImagWet__FDK[ch][hyb]);
|
||||||
} /* loop hyb */
|
} /* loop hyb */
|
||||||
} /* loop ch */
|
} /* loop ch */
|
||||||
err = subbandTPApply(
|
err = subbandTPApply(
|
||||||
@@ -1341,11 +1343,11 @@ static SACDEC_ERROR SpatialDecApplyParameterSets(
|
|||||||
FIXP_DBL *RESTRICT pRealWet = self->hybOutputRealWet__FDK[ch];
|
FIXP_DBL *RESTRICT pRealWet = self->hybOutputRealWet__FDK[ch];
|
||||||
FIXP_DBL *RESTRICT pImagWet = self->hybOutputImagWet__FDK[ch];
|
FIXP_DBL *RESTRICT pImagWet = self->hybOutputImagWet__FDK[ch];
|
||||||
for (hyb = 0; hyb < nHybBands; hyb++) {
|
for (hyb = 0; hyb < nHybBands; hyb++) {
|
||||||
pRealDry[hyb] += pRealWet[hyb];
|
pRealDry[hyb] = fAddSaturate(pRealDry[hyb], pRealWet[hyb]);
|
||||||
pImagDry[hyb] += pImagWet[hyb];
|
pImagDry[hyb] = fAddSaturate(pImagDry[hyb], pImagWet[hyb]);
|
||||||
} /* loop hyb */
|
} /* loop hyb */
|
||||||
for (; hyb < self->hybridBands; hyb++) {
|
for (; hyb < self->hybridBands; hyb++) {
|
||||||
pRealDry[hyb] += pRealWet[hyb];
|
pRealDry[hyb] = fAddSaturate(pRealDry[hyb], pRealWet[hyb]);
|
||||||
} /* loop hyb */
|
} /* loop hyb */
|
||||||
} /* loop ch */
|
} /* loop ch */
|
||||||
} /* ( self->tempShapeConfig == 1 ) || ( self->tempShapeConfig == 2 ) */
|
} /* ( self->tempShapeConfig == 1 ) || ( self->tempShapeConfig == 2 ) */
|
||||||
|
Reference in New Issue
Block a user