Commit 0481f7fb authored by Jan Kiene's avatar Jan Kiene
Browse files

fix ubsan error in sns_avq_dec

parent 944c7622
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@
#define FIX_MEM_REALLOC_IND_LIST                        /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/
#define FIX_581_CLANG_OFFSET_TO_NULL                    /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */
#define JBM_PARAMUPMIX                                  /* Dlb: Issue 471: Integrate the Multichannel Parametric Upmix into the JBM path */
#define FIX_582_INDEX_OUT_OF_BOUNDS_SNS_AVQ_DEC         /* FhG: fix an undefined behaviour error in SNS AVQ decoding */

/* ################## End BE DEVELOPMENT switches ######################### */

+4 −0
Original line number Diff line number Diff line
@@ -161,7 +161,11 @@ void sns_avq_dec(
        {
            for ( i = 0; i < M; i++ )
            {
#ifdef FIX_582_INDEX_OUT_OF_BOUNDS_SNS_AVQ_DEC
                SNS_Q[0][i] = SNS_Q[1][i];
#else
                SNS_Q[0][i] = SNS_Q[0][M + i];
#endif
            }
            sns_2st_dec( SNS_Q[0], index );
        }