From b5597cea85fa41525c99ac68017d94226a2c897f Mon Sep 17 00:00:00 2001 From: Ramesh Katuri Date: Thu, 23 Aug 2018 16:04:03 +0530 Subject: [PATCH] Fix for NPD in case of single coupling channel element. Reason for crash: For the below reported issues input stream has only one coupling channel element. As per the specification coupling channel element should be associated with at least one main channel element. We have different output buffers for main channel and coupling channel. In this error case the coupling channel output buffer is not getting updated because there is no main channel, so main decode is called with output buffer pointing to NULL. This is the reason for all the issues listed below. Bug:112551721 Bug:112704700 Bug:112706520 Bug:112710190 Bug:112712274 Bug:112717301 Test: re-run poc Change-Id: Ife593ca4ae21f05555b6a89092ff76b974e28a67 --- decoder/ixheaacd_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/decoder/ixheaacd_api.c b/decoder/ixheaacd_api.c index afc4510..d77627f 100644 --- a/decoder/ixheaacd_api.c +++ b/decoder/ixheaacd_api.c @@ -2424,7 +2424,11 @@ IA_ERRORCODE ixheaacd_dec_execute( (WORD8 *)p_state_enhaacplus_dec->aac_scratch_mem_v + (8 * 1024) + pers_used; } - actual_out_buffer = p_state_enhaacplus_dec->coup_ch_output; + if (p_obj_exhaacplus_dec->aac_config.element_type[1] < 3 && + p_obj_exhaacplus_dec->aac_config.element_type[1] > 0 && + p_obj_exhaacplus_dec->aac_config.ui_max_channels > 2) { + actual_out_buffer = p_state_enhaacplus_dec->coup_ch_output; + } ch_fac = 1; slot_ele = 0; }