Commit 40dd464d authored by Manuel Jander's avatar Manuel Jander
Browse files

Fix issue 1378 (invalid read access)

parent 44cd194e
Loading
Loading
Loading
Loading

diff

0 → 100644
+1068 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@

#define FIX_867_CLDFB_NRG_SCALE


#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