From ae8a49f64cc75f62079ce3815669974220432155 Mon Sep 17 00:00:00 2001 From: naghibza Date: Wed, 10 Jun 2026 13:10:56 +0200 Subject: [PATCH] replace loop counter tmp with UWord64 in rc_uni_dec_read_bits() --- lib_com/options.h | 1 + lib_dec/ivas_range_uni_dec_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index f37a0c7a8..e985a75ef 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -87,6 +87,7 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */ +#define FIX_BASOP_2626_RC_UNI_DEC_READ_BITS_HANG /* FhG: BASOP #2626: rc_uni_dec_read_bits: replace loop counter tmp with UWord64; with UWord32 the division-substitute loop (tmp <= low) never terminates after the bit-error sentinel sets rc_low=0xFFFFFFFF -> decoder hang on corrupted bitstreams */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_range_uni_dec_fx.c b/lib_dec/ivas_range_uni_dec_fx.c index 540c33123..aa16565f6 100644 --- a/lib_dec/ivas_range_uni_dec_fx.c +++ b/lib_dec/ivas_range_uni_dec_fx.c @@ -380,7 +380,11 @@ UWord16 rc_uni_dec_read_bits( UWord32 val; UWord32 low; /* local copy (2 to 6 uses) */ UWord32 range; /* local copy (4 to 7 uses) */ +#ifdef FIX_BASOP_2626_RC_UNI_DEC_READ_BITS_HANG + UWord64 tmp; +#else UWord32 tmp; +#endif low = rc_st_dec->rc_low; /*Q0*/ range = rc_st_dec->rc_range; /*Q0*/ move32(); -- GitLab