Skip to content

USAN error in swb_tbe_enc.c: "-inf is outside the range of representable values of type 'short'" for OMASA encoding

Basic info

Bug description

Clang usan sanitizer test in pipeline found an error:

lib_enc/swb_tbe_enc.c:2741:15: runtime error: -inf is outside the range of representable values of type 'short'
SUMMARY: UndefinedBehaviorSanitizer: float-cast-overflow lib_enc/swb_tbe_enc.c:2741:15 in 

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

Ways to reproduce

Using the scripts:

python3 scripts/IvasBuildAndRunChecks.py --checks CLANG3 -m OMASA_ISM4_2TC_ball_fb_rs -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 4 2 ltv48_OMASA_4ISM_2TC_ISM1.csv lv48_OMASA_4ISM_2TC_ISM2.csv ltv48_OMASA_4ISM_2TC_ISM3.csv ltv48_OMASA_4ISM_2TC_ISM4.csv ltv48_OMASA_4ISM_2TC.met -max_band fb scripts/switchPaths/sw_13k2_512k.bin 48 ltv48_OMASA_4ISM_2TC.wav bit