Skip to content

USAN: OOB indexing in tcx_ltp_pitch_search_ivas function

Basic info

Bug description

USAN found an out-of-bounds indexing:

 	lib_enc/tcx_ltp_enc_fx.c:422:18: runtime error: index -25 out of bounds for type 'Word32 [256]'
	    #0 0x926890 in tcx_ltp_pitch_search_ivas_fx /ivas-basop/lib_enc/tcx_ltp_enc_fx.c:422:18
	    #1 0x9204e1 in tcx_ltp_encode_ivas_fx /ivas-basop/lib_enc/tcx_ltp_enc_fx.c:1002:13
	    #2 0x9c0fb4 in core_signal_analysis_high_bitrate_ivas_fx /ivas-basop/lib_enc/ext_sig_ana_fx.c:592:9
	    #3 0x84a979 in stereo_tcx_core_enc /ivas-basop/lib_enc/ivas_tcx_core_enc_fx.c:379:5
	    #4 0xa1142c in ivas_core_enc_fx /ivas-basop/lib_enc/ivas_core_enc_fx.c:354:13
	    #5 0xac0fc4 in ivas_cpe_enc_fx /ivas-basop/lib_enc/ivas_cpe_enc_fx.c:1230:5
	    #6 0x485ea3 in ivas_enc_fx /ivas-basop/lib_enc/ivas_enc_fx.c:182:9
	    #7 0x43d5a8 in IVAS_ENC_EncodeFrameToSerial /ivas-basop/lib_enc/lib_enc_fx.c:1502:13
	    #8 0x42cf18 in main /ivas-basop/apps/encoder.c:877:28
	    #9 0x7fd13c58dd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
	    #10 0x7fd13c58de3f in __libc_start_main csu/../csu/libc-start.c:392:3
	    #11 0x4045b4 in _start (/ivas-basop/IVAS_cod+0x4045b4)

	SUMMARY: UndefinedBehaviorSanitizer: out-of-bounds-index lib_enc/tcx_ltp_enc_fx.c:422:18 in 

It needs to be checked if this is an actual bug or a somewhat "false positive" that is assigned, but never really used. In any case, it is preferable to fix this to have one less noise in the USAN error reports.

Ways to reproduce

make clean
make -j CLANG=3
IVAS_cod -stereo -dtx 13200 32 scripts/testv/stvST32n.wav bit
Edited by Jan Kiene