Commit cd48a9f0 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix for #1477 - sanity check to correct position

parent 867217ee
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#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 )
        {
#ifndef 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