From 70c50178b88d8c1bc321092f2848ad482de58595 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 29 Jan 2025 17:12:48 +0100 Subject: [PATCH] fix if() condition, prevent crash when CPE is NULL --- lib_enc/ivas_core_pre_proc_front.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 36da36c128..4d43fce471 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -222,8 +222,9 @@ ivas_error pre_proc_front_ivas( } #ifdef DEBUG_MODE_INFO - if ( !( hCPE->hStereoTD != NULL && n > 0 ) ) + if ( !( hCPE != NULL && hCPE->hStereoTD != NULL && n > 0 ) ) { + /* for TD stereo only write out first channel. The existence of a second channel can vary, this is just easier to handle */ int16_t tmp_dmx_in[L_FRAME48k]; mvr2s( signal_in - NS2SA( st->input_Fs, ACELP_LOOK_NS ), tmp_dmx_in, input_frame ); dbgwrite( tmp_dmx_in, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "ivas_input_dmx", 0, n + 1, ENC ), ".pcm" ) ); -- GitLab