Loading lib_com/options.h +5 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ #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_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #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 */ /* #################### End BE switches ################################## */ Loading lib_dec/ACcontextMapping_dec_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -614,6 +614,7 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( move16(); s = 0; move16(); /* Main Loop through the 2-tuples */ FOR( k = 0; k < lastnz; k += 2 ) { Loading Loading @@ -701,9 +702,15 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( c = add( 12, esc_nb ); } #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = shl( s_and( s, 0x0F ), 4 ); /*Shift old 4 bits*/ s = add( s, c ); /*replace last 4 bits*/ t = s_and( s, 0xFF ); #else s = (UWord16) L_shl( s, 4 ); /*Shift old 4 bits*/ s = (UWord16) L_add( s, c ); /*replace last 4 bits*/ t = (UWord16) L_and( s, 0xFF ); #endif } /* Decode signs */ Loading lib_dec/ivas_mct_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -699,7 +699,11 @@ ivas_error mct_dec_reconfigure_fx( move16(); /* MDCT stereo initialization */ #ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) #else IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) #endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } Loading lib_enc/ACcontextMapping_enc_fx.c +10 −0 Original line number Diff line number Diff line Loading @@ -1099,8 +1099,13 @@ void RCcontextMapping_encode2_no_mem_s17_LCS_fx( } /*Shift old 4 bits, replace last 4 bits*/ #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = add( shl( s_and( s, 0x0F ), 4 ), cp ); t = s_and( s, 0xFF ); #else s = (UWord16) ( L_add( L_shl( s, 4 ), cp ) ); t = (UWord16) L_and( s, 0xFF ); #endif } /*end of the 2-tuples loop*/ } Loading Loading @@ -1564,8 +1569,13 @@ Word16 RCcontextMapping_encode2_estimate_no_mem_s17_LCS_fx( cp = add( 12, esc_nb ); /* Q0 */ } /*shift old bits and replace last 4 bits*/ #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = add( shl( s_and( s, 0x0F ), 4 ), cp ); t = s_and( s, 0xFF ); #else s = (UWord16) L_add( L_shl( s, 4 ), cp ); t = s_and( s, 0xFF ); #endif } /*end of the 2-tuples loop*/ tot_bits2 = round_fx( W_shl_sat_l( nbits2_fx, -Q7 ) ); /* Q23 -> Q16 -> Q0 */ Loading lib_enc/enc_acelp_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -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*/ Loading Loading
lib_com/options.h +5 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ #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_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #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 */ /* #################### End BE switches ################################## */ Loading
lib_dec/ACcontextMapping_dec_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -614,6 +614,7 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( move16(); s = 0; move16(); /* Main Loop through the 2-tuples */ FOR( k = 0; k < lastnz; k += 2 ) { Loading Loading @@ -701,9 +702,15 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( c = add( 12, esc_nb ); } #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = shl( s_and( s, 0x0F ), 4 ); /*Shift old 4 bits*/ s = add( s, c ); /*replace last 4 bits*/ t = s_and( s, 0xFF ); #else s = (UWord16) L_shl( s, 4 ); /*Shift old 4 bits*/ s = (UWord16) L_add( s, c ); /*replace last 4 bits*/ t = (UWord16) L_and( s, 0xFF ); #endif } /* Decode signs */ Loading
lib_dec/ivas_mct_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -699,7 +699,11 @@ ivas_error mct_dec_reconfigure_fx( move16(); /* MDCT stereo initialization */ #ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) #else IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) #endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } Loading
lib_enc/ACcontextMapping_enc_fx.c +10 −0 Original line number Diff line number Diff line Loading @@ -1099,8 +1099,13 @@ void RCcontextMapping_encode2_no_mem_s17_LCS_fx( } /*Shift old 4 bits, replace last 4 bits*/ #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = add( shl( s_and( s, 0x0F ), 4 ), cp ); t = s_and( s, 0xFF ); #else s = (UWord16) ( L_add( L_shl( s, 4 ), cp ) ); t = (UWord16) L_and( s, 0xFF ); #endif } /*end of the 2-tuples loop*/ } Loading Loading @@ -1564,8 +1569,13 @@ Word16 RCcontextMapping_encode2_estimate_no_mem_s17_LCS_fx( cp = add( 12, esc_nb ); /* Q0 */ } /*shift old bits and replace last 4 bits*/ #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = add( shl( s_and( s, 0x0F ), 4 ), cp ); t = s_and( s, 0xFF ); #else s = (UWord16) L_add( L_shl( s, 4 ), cp ); t = s_and( s, 0xFF ); #endif } /*end of the 2-tuples loop*/ tot_bits2 = round_fx( W_shl_sat_l( nbits2_fx, -Q7 ) ); /* Q23 -> Q16 -> Q0 */ Loading
lib_enc/enc_acelp_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -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*/ Loading