From 19365a2fa4bbc9302ca0db59368e26419aa45a8d Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 18 Jun 2024 10:31:17 +0200 Subject: [PATCH] fix issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core; under NONBE_1131_ACELP_OOB --- lib_com/options.h | 1 + lib_dec/acelp_core_dec.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index cdff54f506..f89bbd621d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ #define REVERT_ZERO_FLUSH_TRESH /* FhG: issue 1069: revert threshold value introduced with !1518 due to significant complexity increase*/ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ +#define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 02637caf2d..7a04be73da 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -699,7 +699,11 @@ ivas_error acelp_core_dec( old_exc_s = st->old_exc + L_EXC_MEM_DEC - st->L_frame; tmpF = *old_exc_s; st->mem_deemph = old_exc_s[st->L_frame - 1]; +#ifdef NONBE_1131_ACELP_OOB + preemph( old_exc_s, st->preemph_fac, st->L_frame, &tmpF ); +#else preemph( old_exc_s, st->preemph_fac, L_FRAME16k, &tmpF ); +#endif mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M ); residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame ); } -- GitLab