Commit 066d126b authored by reutelhuber's avatar reutelhuber
Browse files

fix issue 625: UBSAN index out-of-bounds

parent 481a7b16
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@
#define FIX_615_UBSAN_SPAR_TO_DIRAC                     /*Dlb : Fix for UBSAN issue 615*/
#define FIX_626_VARIABLE_TYPE_MDCT_CONC                 /* FhG: trivial fix to fix USAN error */
#define FIX_616_DIV_ZERO_MCT                            /*FhG : Fix UBSAN division by zero error of issue 616*/
#define FIX_625_IDX_OOB                                 /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */

/* ################## End BE DEVELOPMENT switches ######################### */

lib_dec/ivas_spar_decoder.c

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -1026,7 +1026,11 @@ static void ivas_spar_calc_smooth_facs(

        /* 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++ )
            {