diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index 0e4e064ab7ab3ff96f7bd1869549642bc21dd050..5628bc1331dd841c9bdd5b5928ec01ac683e7054 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -205,6 +205,7 @@ #define FIX617_UBSAN_DIVBYZERO_STEREOCNG /* Eri: Issue 617: Decoder UBSAN: division by zero in stereo cng when inut is 16kHz and output is 32kHz */ #define FIX_279_CODE_COVERAGE /* Dlb : issue 279 , clean up unused function */ #define FIX_549_PARAM_ISM_BIN_GAIN /* FhG: Issue 549 : fix too quiet binaural output in ParamISM */ +#define FIX_625_IDX_OOB /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */ /* ################## End BE DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c old mode 100644 new mode 100755 index 1c839316e52fefb4ad4f4e44bc7d7533cd95efe8..195bf57dfb14c87cf8babca5e76b6acc03636562 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1019,14 +1019,22 @@ static void ivas_spar_calc_smooth_facs( bin = 0; for ( b = 0; b < nbands_spar; b++ ) { +#ifdef FIX_625_IDX_OOB + if ( bin >= CLDFB_NO_CHANNELS_MAX || ( b > 0 && bin2band->p_cldfb_map_to_spar_band[bin] < bin2band->p_cldfb_map_to_spar_band[bin - 1] ) ) +#else if ( b > 0 && bin2band->p_cldfb_map_to_spar_band[bin] < bin2band->p_cldfb_map_to_spar_band[bin - 1] ) +#endif { break; } /* calculate band-wise subframe energies */ subframe_band_nrg[b] = 0.f; +#ifdef FIX_625_IDX_OOB + while ( bin < CLDFB_NO_CHANNELS_MAX && b == bin2band->p_cldfb_map_to_spar_band[bin] ) +#else while ( b == bin2band->p_cldfb_map_to_spar_band[bin] ) +#endif { for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) {