From 4b534351d031ad4c5ef69aa294962595d4f3877f Mon Sep 17 00:00:00 2001 From: naghibza Date: Tue, 14 Oct 2025 14:36:55 +0200 Subject: [PATCH] add two bits headroom to prevent overflow in ivas_omasa_render_objects_from_mix_fx() --- lib_com/options.h | 1 + lib_dec/ivas_omasa_dec_fx.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 73a330f04..08fb301c5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -114,6 +114,7 @@ #define FIX_2083_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/ #define FIX_2085_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in ivas_dirac_config_fx() */ +#define FIX_2092_ASSERT_IN_OMASA_RENDER /* FhG: add two bits headroom to prevent overflow in ivas_omasa_render_objects_from_mix_fx() */ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 7278b9968..b3d8f082f 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -2123,12 +2123,19 @@ void ivas_omasa_render_objects_from_mix_fx( outSlotImPr = &( outIm[n][slot][0] ); move32(); move32(); +#ifdef FIX_2092_ASSERT_IN_OMASA_RENDER + mantissa_exp_to_qvalue( &outRe_exp[n][slot][0], &outRe[n][slot][0], Q20 + Q2, nBins ); // + Q2: add two bits headroom to prevent overflow in cldfbSynthesis_ivas_fx(). + mantissa_exp_to_qvalue( &outIm_exp[n][slot][0], &outIm[n][slot][0], Q20 + Q2, nBins ); + cldfbSynthesis_ivas_fx( &outSlotRePr, &outSlotImPr, &rendered_objects[n][index], + nBins, 0, 1 + Q2, st_ivas->cldfbSynDec[index2] ); +#else mantissa_exp_to_qvalue( &outRe_exp[n][slot][0], &outRe[n][slot][0], Q20, nBins ); mantissa_exp_to_qvalue( &outIm_exp[n][slot][0], &outIm[n][slot][0], Q20, nBins ); cldfbSynthesis_ivas_fx( &outSlotRePr, &outSlotImPr, &rendered_objects[n][index], nBins, 0, 1, st_ivas->cldfbSynDec[index2] ); +#endif } } -- GitLab