diff --git a/lib_dec/ivas_out_setup_conversion_fx.c b/lib_dec/ivas_out_setup_conversion_fx.c index 2135cd6d61693c9fea163a9ff1a496f3e524fe8b..6e78e9c6902bf5e4188d3e264f3ec4faaa583ca3 100644 --- a/lib_dec/ivas_out_setup_conversion_fx.c +++ b/lib_dec/ivas_out_setup_conversion_fx.c @@ -695,6 +695,11 @@ void ivas_ls_setup_conversion_process_mdct_fx( Word16 guard_1 = shr( add( find_guarded_bits_fx( tmp_sub ), 1 ), 1 ); Word16 guard_2 = find_guarded_bits_fx( L_mult0( outChannels, inChannels ) ); q_output = sub( q_output, s_max( guard_1, guard_2 ) ); + /* Increase the guard bit by 1 to avoid overflow only if q_output is positive */ + if ( q_output > 0 ) + { + q_output = sub( q_output, 1 ); + } FOR( i = 0; i < inChannels; ++i ) {