Commit 0a270923 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'basop-2274-usan-oob-indexing-in-e_acelp_corrmatrix_fx-function' into 'main'

Resolve "USAN: OOB indexing in E_ACELP_corrmatrix_fx function"

Closes #2274

See merge request !2657
parents 15135e63 00b28c27
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@
#define FIX_2252_SCALING_SAVE_HB_SYNTH                  /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */
#define FIX_2248_EVS_ASSERT                             /* VA: Include _sat in an EVS related part of the code */
#define FIX_2254_IMPROV_COMPLEXITY_BE                   /* VA: BE small complexity reduction  */
#define FIX_2274_OOB_INDEXING_IN_CORRMATRIX             /* FhG: fix OOB indexing complaint */
#define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */
#define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE       /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */

+7 −0
Original line number Diff line number Diff line
@@ -997,7 +997,14 @@ void E_ACELP_corrmatrix_fx(
        p3 = &rrixiy[2][pos]; /* Q9 */
        p2 = &rrixiy[1][pos];
        p1 = &rrixiy[0][pos];
#ifdef FIX_2274_OOB_INDEXING_IN_CORRMATRIX
        p0 = &rrixiy[3][pos];
        /* decrement pointer instead of indexing the array to avoid CLANG Usan complaint */
        /* for last loop iteration, this points to rrixiy[3][-1], but is not actually accessed in later loop (k = 15 then, so inner loop will not run) */
        p0 -= 16;
#else
        p0 = &rrixiy[3][pos - 16];
#endif

        cor = L_deposit_h( 0 );
        ptr_h1 = h;      /*Q12*/