From 7ddba8b6db0917bff4a29fa625747dc40124d679 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 26 Oct 2022 07:48:33 +0200 Subject: [PATCH] Added fix FIX_I178_HQ_BUFFER_OVERRUN to fix a too short buffer for the spectral fill codebook --- lib_com/fill_spectrum.c | 8 ++++++++ lib_com/options.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/fill_spectrum.c b/lib_com/fill_spectrum.c index 9b743a5f1c..c1837d5140 100644 --- a/lib_com/fill_spectrum.c +++ b/lib_com/fill_spectrum.c @@ -90,10 +90,18 @@ void fill_spectrum( const int16_t element_mode /* i : element mode */ ) { +#ifdef FIX_I178_HQ_BUFFER_OVERRUN + float CodeBook[L_SPEC48k_EXT]; +#else float CodeBook[FREQ_LENGTH]; +#endif int16_t cb_size = 0; int16_t last_sfm; +#ifdef FIX_I178_HQ_BUFFER_OVERRUN + float CodeBook_mod[L_SPEC48k_EXT]; +#else float CodeBook_mod[FREQ_LENGTH]; +#endif float norm_adj[NB_SFM]; int16_t high_sfm = 23; int16_t flag_32K_env_hangover; diff --git a/lib_com/options.h b/lib_com/options.h index b988fcb581..eea64354c1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -152,7 +152,7 @@ #define FIX_155_HP20_ISSUE /* Issue 155: apply hp20 on all input channels instead of just 2 channels */ #define EFAP_FIX_POLY /* Issue 167: fix bug in EFAP polygon selection */ #define SBA_HOA_HBR_IMPROV /* issue 91: Improvements to SBA high bitrate HOA3 coding */ - +#define FIX_I178_HQ_BUFFER_OVERRUN /* issue 178: Buffer overrun in HQ core decoder -- spectral filling buffer did not account for extended transition frame in IVAS */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ -- GitLab