Commit 302a1e30 authored by Jan Kiene's avatar Jan Kiene
Browse files

don't apply the fix on init to avoid use of uninit values

parent 4c58a567
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -118,6 +118,9 @@ void initFdCngCom(
    hFdCngCom->stopBand = 0;
    hFdCngCom->startBand = 0;
    hFdCngCom->stopFFTbin = 0;
#ifdef FIX_TMP_1559
    hFdCngCom->nFFTpart = 0;
#endif
    hFdCngCom->frameSize = 0;
    hFdCngCom->fftlen = 0;
    hFdCngCom->seed = 0;
+8 −4
Original line number Diff line number Diff line
@@ -325,11 +325,15 @@ void configureFdCngDec(
#ifdef FIX_1559
    /* In case of going from a lower number of partitions to a higher number, initialize
    the higher ines which might be zero and/or outdated with the highest partitions value
       this avoids almost-zero values to linger around and causing signal bursts after switching to higher bitrate */
    this avoids almost-zero values to linger around and causing signal bursts after switching to higher bitrate.
    Don't do this on initialization of the codec (nFFTpart_prev == 0)*/
    if ( nFFTpart_prev != 0 )
    {
        for ( j = nFFTpart_prev; j < hsCom->nFFTpart; ++j )
        {
            hFdCngDec->partNoiseShape[j] = hFdCngDec->partNoiseShape[nFFTpart_prev - 1];
        }
    }
#endif

    stopBandFR = (int16_t) floor( 1000.f /*Hz*/ / 25.f /*Hz/Bin*/ );