Skip to content

[CLANG18] MSAN: use-of-uninitialized-value in lib_dec/hq_hr_dec.c:284:5

Basic Info

Bug description

Clang 18 MSAN found an use-of-uninitialized-value error at lib_dec/hq_hr_dec.c:284:5:

==19783==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5565bed2d467 in hq_hr_dec /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/hq_hr_dec.c:284:5
#1 0x5565bed1f440 in hq_core_dec /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/hq_core_dec.c:252:13
#2 0x5565bf4d102a in ivas_core_dec /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/ivas_core_dec.c:369:13
#3 0x5565bf4f32a0 in stereo_dft_dec_main /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/ivas_cpe_dec.c:613:20
#4 0x5565bf4eeb2d in ivas_cpe_dec /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/ivas_cpe_dec.c:454:24
#5 0x5565bede19f0 in ivas_jbm_dec_tc /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/ivas_jbm_dec.c:126:24
#6 0x5565bead93d4 in IVAS_DEC_GetSamplesDecoder /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/lib_dec.c:1189:28
#7 0x5565beab49b8 in decodeG192 /builds/rep/ivas-codec-pc/ivas-codec/apps/decoder.c:2601:32
#8 0x5565bea98a74 in main /builds/rep/ivas-codec-pc/ivas-codec/apps/decoder.c:790:17
#9 0x7f7ed0e2e1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#10 0x7f7ed0e2e28a in __libc_start_main csu/../csu/libc-start.c:360:3
#11 0x5565be9fa634 in _start (/builds/rep/ivas-codec-pc/ivas-codec/IVAS_dec+0x3a634) (BuildId: d0744cb80465af84d863a5374179875c8af406c0)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /builds/rep/ivas-codec-pc/ivas-codec/lib_dec/hq_hr_dec.c:284:5 in hq_hr_dec

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 -stereo 32000 16 scripts/testv/stvST16c.wav stvST16c.wav_stereo_at_32_kbps_16kHz_in_16kHz_out.192
IVAS_dec -fr 20 STEREO 16 stvST16c.wav_stereo_at_32_kbps_16kHz_in_16kHz_out.192 stvST16c.wav_stereo_at_32_kbps_16kHz_in_16kHz_out.dec.wav

or

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