From 48acc449aae841ca28c949cfffe583c62527b7a7 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 6 May 2025 15:09:06 +0200 Subject: [PATCH] port MR 1344 from float add comment that fix is not needed --- lib_com/options.h | 1 + lib_dec/igf_scf_dec_fx.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 71e860604..4e21bf35d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -99,6 +99,7 @@ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ +#define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/igf_scf_dec_fx.c b/lib_dec/igf_scf_dec_fx.c index 1ddb9950a..3db6581da 100644 --- a/lib_dec/igf_scf_dec_fx.c +++ b/lib_dec/igf_scf_dec_fx.c @@ -189,6 +189,9 @@ static void decode_sfe_vector_fx( { /* (t == 0) && (f == 0) */ /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ +#ifdef FIX_969_USAN_IGF_ARITH + /* NOTE: the float equivalent uses a tmp variable + explicit cast here to avoid undefined behaviour here. This BASOP version does not need it as it already uses signed Word16 return value here. */ +#endif res = ari_decode_14bits_s27_ext_fx( st, &hPrivateData->acState, (const UWord16 *) hPrivateData->cf_se00 ); pred = arith_decode_bits_fx( hPrivateData, st, 2 ); /* LSBs as 2 bit raw */ -- GitLab