[Non-BE] Resolve: MSAN: use-of-uninitialized-value in MASA DTX encoding - float
- Related issues: sa4/audio/ivas-basop#2317 (closed), #1497 (closed)
- Related BASOP MR: sa4/audio/ivas-basop!2750 (merged)
- Requested reviewers: @multrus
Reason why this change is needed
- During BW switching and CNG when the stereo CNG is used, the decision to enable DTX/CNG is taken once the down-mix signal is prepared. The sideGain parameters are calculated before the down-mix is prepared, which means the bandwidth and number of bands may be increased afterwards. In the preparation of the Stereo CNG side gain parameters, this may lead to uninitialized values being read. The last band is already extrapolated earlier in stereo_dft_enc_compute_prm, but it was not properly propagated to
hStereoDft->sidSideGain.
/* Replicate last band for remaining bands in case the bandwidth is higher after SID/NODATA is considered */
for ( i = hStereoDft->nbands; i < STEREO_DFT_BAND_MAX; i++ )
{
pPredGain[i] = pPredGain[i - 1];
pSideGain[i] = pSideGain[i - 1];
}
Description of the change
- Copy all pSideGain values to hStereoDft->sidSideGain.
Affected operating points
- Small impact expected for all bit rates where BW switching occurs and Stereo CNG is used.
Edited by norvell