USAN "implicit-signed-integer-truncation" in 2 and 4 ISM encoding
Basic info
- Commit SHA: 0ddbb7a5
Bug description
Clang usan sanitizer test in pipeline found an error:
lib_com/ari_hm.c:299:13: runtime error: implicit conversion from type 'int' of value -32819 (32-bit, signed) to type 'int16_t' (aka 'short') changed the value to 32717 (16-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: implicit-signed-integer-truncation lib_com/ari_hm.c:299:13 in
The error occurs in a TCX-related function.
Link to test pipeline: https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/jobs/204429
Also happens in ISM4 pipeline: https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/jobs/204431
Ways to reproduce
Using the scripts:
python3 scripts/IvasBuildAndRunChecks.py --checks CLANG3 -m ISM2_b16_4_wb_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 2 NULL NULL -max_band wb 16400 16 ltv16_2ISM.wav bit
Edited by Jan Kiene