Commit f3550e69 authored by Manuel Jander's avatar Manuel Jander
Browse files

Fix issue 1378 (invalid read access)

parent a41631d3
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -171,5 +171,6 @@
//#define OPT_STEREO_32KBPS_V1                    /* Optimization made in stereo decoding path for 32kbps decoding */
#define DOT_PROD_CHOLESKY_64BIT                 /* FhG: Issue 1323, optimized 64 bit implementation of dot_product_cholesky() */
#define OPT_BASOP_ADD_v1                        /* optimizations to avoid usage of BASOP_Util_Add_MantExp */
#define FIX_1378_ACELP_OUT_OF_BOUNDS            /* Avoid index -1 in array read access  */
#define FIX_ISSUE_1327                          /* Ittiam: Fix for issue 1327: Glitch when stereo is switching from TD to FD*/
#endif
+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