Commit 064ed4ee authored by norvell's avatar norvell
Browse files

Merge branch '878-buffer-overflow-in-stereo-dtx-rate-switching-with-frame-errors' into 'main'

[Non BE] Fix of Stereo CNG parameters bit rate to eliminate false BER detect and corrupt bitstream reading in rate switching.

See merge request !1233
parents cdc3b6b9 28d91bab
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100755 → 100644
+2 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@
#define NONBE_FIX_874_OMASA_BRSW_2TD                          /* Nokia: issue 874: Fixes the crashes with the long test vectors that prompted switching to TD*/
#define NONBE_FIX_871_ACELP_CRASH_IN_OSBA                     /* FhG: isse 871: crash in ACELP core encoder with OSBA */
#define NONBE_FIX_906_SBA_LBR_SMOOTHING                       /* FhG: issue #906: fix SBA low bit rate smoothing for HOA2/HOA3 output */
#define NONBE_FIX_878_RS_FEC_STEREO_CNG                       /* Eri: Frame loss and Unified Stereo CNG may cause false BER detection which results in corrupt bitstream decoding */

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+4 −0
Original line number Diff line number Diff line
@@ -248,6 +248,10 @@ ivas_error ivas_cpe_dec(
            {
                nb_bits -= SID_FORMAT_NBITS;
                sts[1]->bit_stream -= SID_FORMAT_NBITS;
#ifdef NONBE_FIX_878_RS_FEC_STEREO_CNG
                /* set total bitrate of Stereo CNG parameters for BER detection */
                sts[1]->total_brate = IVAS_SID_5k2 - SID_2k40;
#endif
            }

            if ( ( ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || ( st_ivas->ivas_format == MASA_ISM_FORMAT && cpe_brate < MASA_STEREO_MIN_BITRATE ) ) && ivas_total_brate > IVAS_SID_5k2 )