From cd91e1af765486ea6aad21e258b3a23294fa291d Mon Sep 17 00:00:00 2001 From: Shreyas Talwekar Date: Wed, 30 Aug 2023 19:33:21 +0530 Subject: [PATCH] Fix for the Heap-buffer-overflow in ixheaace_process This change handles the Heap-buffer-overflow by considering the bits used by the SBR encoder for USAC mono streams. Bug: ossFuzz:61825 Test: poc in bug --- encoder/ixheaace_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/encoder/ixheaace_api.c b/encoder/ixheaace_api.c index 8630f86..57bd1b0 100644 --- a/encoder/ixheaace_api.c +++ b/encoder/ixheaace_api.c @@ -3079,7 +3079,8 @@ static IA_ERRORCODE iusace_process(ixheaace_api_struct *pstr_api_struct) { &(pstr_api_struct->pstr_state->num_anc_data_bytes[0][0]), pstr_api_struct->pstr_state->anc_data_bytes[0], &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs), - &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size, 0, NULL); + &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size, 0, + &pstr_api_struct->pstr_state->str_usac_enc_data.num_sbr_bits); if (error != IA_NO_ERROR) { return error; }