Commit 38f66c45 authored by bayers's avatar bayers
Browse files

fix #846, make sure first CPE handle is not accessed when it is still NULL in...

fix #846, make sure first CPE handle is not accessed when it is still NULL in a MASA DTX bit stream with the first frame being a SID frame and JBM
parent 8e40fa16
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@
#define NONBE_FIX_730_DPID_NOT_SET_CORRECTLY                  /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */
#define NONBE_FIX_825_SBA_JBM_MONO_STEREO_OUTPUT              /* FhG: issue #825: Resolve "JBM SBA: AGC and PCA run twice for MONO and STEREO output"   */
#define NONBE_FIX_808_JBM_PARAMUPMIX_RS                       /* FhG: Issue 808: fix JBM MC rate switching */
#define NONBE_FIX_846_JBM_MASA_SIDSTART                       /* FhG: Issue #846: fix JBM for MASA DTX when the first frame is a SID frame */

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

+5 −1
Original line number Diff line number Diff line
@@ -2034,7 +2034,11 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
        {
            num_tc = CPE_CHANNELS;
        }
        else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ( ivas_total_brate > IVAS_SID_5k2 || ( ivas_total_brate <= IVAS_SID_5k2 && st_ivas->nCPE > 0 && st_ivas->hCPE[0]->nchan_out == 1 ) ) )
        else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ( ivas_total_brate > IVAS_SID_5k2 || ( ivas_total_brate <= IVAS_SID_5k2 && st_ivas->nCPE > 0 &&
#ifdef NONBE_FIX_846_JBM_MASA_SIDSTART
                                                                                                                                              st_ivas->hCPE[0] != NULL &&
#endif
                                                                                                                                              st_ivas->hCPE[0]->nchan_out == 1 ) ) )
        {
            num_tc = 1; /* Only one channel transported */
        }