Skip to content

[CLANG18] MSAN: use-of-uninitialized-value in lib_enc/ivas_mct_enc_mct_fx.c:99:27

Basic Info

Bug description

Clang 18 MSAN found an use-of-uninitialized-value error at lib_enc/ivas_mct_enc_mct_fx.c:99:27:

==20021==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5556167639fb in getChannelEnergies_fx /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_mct_enc_mct_fx.c:99:27
#1 0x555616769274 in getGlobalILD_fx /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_mct_enc_mct_fx.c:518:5
#2 0x5556167647e3 in apply_MCT_enc_fx /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_mct_enc_mct_fx.c:676:9
#3 0x5556167568b8 in ivas_mct_core_enc_fx /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_mct_core_enc_fx.c:438:5
#4 0x555615e530c2 in ivas_mct_enc_fx /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_mct_enc_fx.c:418:5
#5 0x555615d27a1c in ivas_enc_fx /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_enc_fx.c:291:13
#6 0x555615c21675 in IVAS_ENC_EncodeFrameToSerial /builds/rep/sa4/audio/ivas-basop/lib_enc/lib_enc_fx.c:1502:13
#7 0x555615c0094a in main /builds/rep/sa4/audio/ivas-basop/apps/encoder.c:877:28
#8 0x7fbe89efe1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#9 0x7fbe89efe28a in __libc_start_main csu/../csu/libc-start.c:360:3
#10 0x555615b60454 in _start (/builds/rep/sa4/audio/ivas-basop/IVAS_cod+0x38454) (BuildId: 1e98dc6728760144942259e69e2f21b3f1a998a8)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /builds/rep/sa4/audio/ivas-basop/lib_enc/ivas_mct_enc_mct_fx.c:99:27 in getChannelEnergies_fx

How to reproduce

⚠️ Make sure to use CLANG v18 for building the codec :warning

Build with

make clean
make -j CLANG=1

Then run

IVAS_cod -sba 1 160000 32 scripts/testv/stvFOA32c.wav stvFOA32c.wav_SBA_at_160_kbps_32kHz_in_32kHz_out_FOA_out.192

or

python3 -m pytest "test_param_file_tests[stv-SBA at 160 kbps, 32kHz in, 32kHz out, FOA out]" -n auto --update_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec