Skip to content

USAN error in PVQ decoder for OMASA decoding

Basic info

Bug description

Clang usan sanitizer test in pipeline found an error:

lib_dec/pvq_core_dec.c:440:82: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change lib_dec/pvq_core_dec.c:440:82 in 

Link to test pipeline: https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/jobs/206854

Ways to reproduce

Using the scripts:

python3 scripts/IvasBuildAndRunChecks.py --checks CLANG3 -m OMASA_ISM1_2TC_b128_fb_cbr -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp

or directly:

make clean
make -j CLANG=3
./IVAS_cod -ism_masa 1 2 ltv48_OMASA_1ISM_2TC_ISM1.csv ltv48_OMASA_1ISM_2TC.met -max_band fb 128000 48 ltv48_OMASA_1ISM_2TC.wav bit
./IVAS_dec mono 48 bit out.wav