Skip to content

USAN errors in OMASA JBM decoding

Basic info

Bug description

Clang usan sanitizer test in pipeline found an error:

ib_dec/jbm_jb4_jmf.c:218:27: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967256 (32-bit, unsigned) to type 'int32_t' (aka 'int') changed the value to -40 (32-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change lib_dec/jbm_jb4_jmf.c:218:27 in 
lib_dec/jbm_jb4_jmf.c:302:49: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967256 (32-bit, unsigned) to type 'JB4_CIRCULARBUFFER_ELEMENT' (aka 'int') changed the value to -40 (32-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change lib_dec/jbm_jb4_jmf.c:302:49 in 
lib_dec/jbm_jb4_jmf.c:209:46: runtime error: implicit conversion from type 'int32_t' (aka 'int') of value -40 (32-bit, signed) to type 'unsigned int' changed the value to 4294967256 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change lib_dec/jbm_jb4_jmf.c:209:46 in 

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

Ways to reproduce

Using the scripts:

JBM profile file: jbm_err_profile.dat

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

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 wb 13200 16 ltv48_OMASA_1ISM_2TC.wav bit
networkSimulator jbm_err_profile.dat bit bit_jbm tracefile 2
./IVAS_dec -Tracefile tracefile -VOIP mono 16 bit_jbm out.wav