Commit 14fa671a authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'float-1477-usan-out-of-bounds-index-in-lib_dec-dec_acelp-c-175-19' into 'main'

Resolve "USAN: out-of-bounds-index in lib_dec/dec_acelp.c:175:19"

See merge request !2459
parents 3a347aa9 a5afc6de
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@
#define FIX_1478_UNINIT_ON_BFI                          /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */
#define FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR          /* Dolby: remove unused noise generator from ISAR */
#define FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX  /* FhG/VA: init nb_bits_metadata to zero */
#define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING          /* FhG: fix oob indexing */

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

+11 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ void D_ACELP_indexing(
        }
        s = index_n[0];
        pulses = pulsestrack[0];
#ifndef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING
        /* safety check in case of bit errors */
        if ( s >= pulsestostates[16][pulses - 1] )
        {
@@ -178,8 +179,18 @@ void D_ACELP_indexing(
            *BER_detect = 1;
            return;
        }
#endif
        if ( pulses )
        {
#ifdef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING
            /* safety check in case of bit errors */
            if ( s >= pulsestostates[16][pulses - 1] )
            {
                set_f( code, 0.0f, L_SUBFR );
                *BER_detect = 1;
                return;
            }
#endif
            D_ACELP_decode_arithtrack( code, s, pulses, num_tracks, 16 );
        }
        else