Commit be68a0d9 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '1378-memory-sanitizer-error-in-acelp-invalid-array-index-1' into 'main'

Resolve "Memory sanitizer error in ACELP, invalid array index -1"

Closes #1378

See merge request !1271
parents 70821497 93d0132d
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@
#define BASOP_NOGLOB_DECLARE_LOCAL
#endif

#define FIX_1378_ACELP_OUT_OF_BOUNDS

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
//#define OPT_STEREO_32KBPS_V1                    /* Optimization made in stereo decoding path for 32kbps decoding */
#define OPT_AVOID_STATE_BUF_RESCALE             /* Optimization made to avoid rescale of synth state buffer */
+12 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ void D_ACELP_indexing_fx(
        pulses = pulsestrack[0];
        move16();

#ifndef FIX_1378_ACELP_OUT_OF_BOUNDS
        /* safety check in case of bit errors */
        IF( GE_64( s, pulsestostates[16][pulses - 1] ) )
        {
@@ -177,9 +178,20 @@ void D_ACELP_indexing_fx(
            move16();
            return;
        }
#endif

        IF( pulses )
        {
#ifdef FIX_1378_ACELP_OUT_OF_BOUNDS
            /* safety check in case of bit errors */
            IF( GE_64( s, pulsestostates[16][pulses - 1] ) )
            {
                set16_fx( code, 0, L_SUBFR );
                *BER_detect = 1;
                move16();
                return;
            }
#endif
            D_ACELP_decode_arithtrack_fx( code, s, pulses, num_tracks, 16 );
        }
        ELSE