From 38f66c455bb70779a5aa37ae647a78f7185ca846 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 4 Oct 2023 07:25:38 +0200 Subject: [PATCH] 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 --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3ccf81b46b..2f14642cf5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 ########################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 943e1e694b..a69965d3f9 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -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 */ } -- GitLab