Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,7 @@ #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 */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1474_USAN_TRANS_INV /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */ /* #################### End BE switches ################################## */ Loading lib_com/trans_direct.c +16 −0 Original line number Diff line number Diff line Loading @@ -100,19 +100,31 @@ void direct_transform( in32_r16[i] = in32[L - 1 - i]; in32_r16[L - 1 - i] = in32[i]; } #ifndef FIX_1474_USAN_TRANS_INV iseg = in32_r16 - segment_length / 4; #endif oseg = out32; wh = win + segment_length / 4; wl = win + segment_length / 4 - 1; #ifdef FIX_1474_USAN_TRANS_INV sh = in32_r16 + 2 * segment_length / 4; sl = in32_r16 + 2 * segment_length / 4 - 1; #else sh = iseg + 3 * segment_length / 4; sl = iseg + 3 * segment_length / 4 - 1; #endif for ( i = 0; i < segment_length / 4; i++ ) { dctin32[i] = ( ( *wl-- * *sl-- ) - ( *wh++ * *sh++ ) ); } #ifdef FIX_1474_USAN_TRANS_INV sl = in32_r16 + segment_length / 4 - 1; #else sl = iseg + segment_length / 2 - 1; #endif for ( i = 0; i < segment_length / 4; i++ ) { Loading @@ -121,7 +133,11 @@ void direct_transform( edct( dctin32, oseg, segment_length / 2, element_mode ); #ifdef FIX_1474_USAN_TRANS_INV iseg = in32_r16 + segment_length / 4; #else iseg = iseg + segment_length / 2; #endif oseg = oseg + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) Loading lib_com/trans_inv.c +16 −0 Original line number Diff line number Diff line Loading @@ -838,22 +838,38 @@ void inverse_transform( } } #ifdef FIX_1474_USAN_TRANS_INV out_segment = out_alias; #else out_segment = out_alias - segment_length / 4; #endif in_segment = in_mdct_modif; iedct_short( in_segment, alias, segment_length, element_mode ); for ( ta = segment_length / 4; ta < segment_length / 2; ta++ ) { #ifdef FIX_1474_USAN_TRANS_INV *out_segment++ = alias[ta]; #else out_segment[ta] = alias[ta]; #endif } for ( ta = segment_length / 2; ta < segment_length; ta++ ) { #ifdef FIX_1474_USAN_TRANS_INV *out_segment++ = alias[ta] * win[ta]; #else out_segment[ta] = alias[ta] * win[ta]; #endif } #ifdef FIX_1474_USAN_TRANS_INV out_segment = out_alias + segment_length / 4; #else out_segment = out_segment + segment_length / 2; #endif in_segment = in_segment + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,7 @@ #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 */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1474_USAN_TRANS_INV /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */ /* #################### End BE switches ################################## */ Loading
lib_com/trans_direct.c +16 −0 Original line number Diff line number Diff line Loading @@ -100,19 +100,31 @@ void direct_transform( in32_r16[i] = in32[L - 1 - i]; in32_r16[L - 1 - i] = in32[i]; } #ifndef FIX_1474_USAN_TRANS_INV iseg = in32_r16 - segment_length / 4; #endif oseg = out32; wh = win + segment_length / 4; wl = win + segment_length / 4 - 1; #ifdef FIX_1474_USAN_TRANS_INV sh = in32_r16 + 2 * segment_length / 4; sl = in32_r16 + 2 * segment_length / 4 - 1; #else sh = iseg + 3 * segment_length / 4; sl = iseg + 3 * segment_length / 4 - 1; #endif for ( i = 0; i < segment_length / 4; i++ ) { dctin32[i] = ( ( *wl-- * *sl-- ) - ( *wh++ * *sh++ ) ); } #ifdef FIX_1474_USAN_TRANS_INV sl = in32_r16 + segment_length / 4 - 1; #else sl = iseg + segment_length / 2 - 1; #endif for ( i = 0; i < segment_length / 4; i++ ) { Loading @@ -121,7 +133,11 @@ void direct_transform( edct( dctin32, oseg, segment_length / 2, element_mode ); #ifdef FIX_1474_USAN_TRANS_INV iseg = in32_r16 + segment_length / 4; #else iseg = iseg + segment_length / 2; #endif oseg = oseg + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) Loading
lib_com/trans_inv.c +16 −0 Original line number Diff line number Diff line Loading @@ -838,22 +838,38 @@ void inverse_transform( } } #ifdef FIX_1474_USAN_TRANS_INV out_segment = out_alias; #else out_segment = out_alias - segment_length / 4; #endif in_segment = in_mdct_modif; iedct_short( in_segment, alias, segment_length, element_mode ); for ( ta = segment_length / 4; ta < segment_length / 2; ta++ ) { #ifdef FIX_1474_USAN_TRANS_INV *out_segment++ = alias[ta]; #else out_segment[ta] = alias[ta]; #endif } for ( ta = segment_length / 2; ta < segment_length; ta++ ) { #ifdef FIX_1474_USAN_TRANS_INV *out_segment++ = alias[ta] * win[ta]; #else out_segment[ta] = alias[ta] * win[ta]; #endif } #ifdef FIX_1474_USAN_TRANS_INV out_segment = out_alias + segment_length / 4; #else out_segment = out_segment + segment_length / 2; #endif in_segment = in_segment + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) Loading