diff --git a/lib_com/options.h b/lib_com/options.h index b617472faff37c1e5766e93af891844bb14c27a2..08791c0959cab24b647de61b3027b6691fae8b49 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,6 +153,7 @@ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ +#define FIX_1995_REVERB_INIT /* issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index a14af6f3d24842be602f8f4b950b2292150f83eb..72821e91202312e1bb79f66e5b5cc42281561f36 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1868,6 +1868,7 @@ static ivas_error ivas_binaural_reverb_open( * Allocate and initialize binaural room reverberator handle * for CLDFB renderers *------------------------------------------------------------------------*/ + ivas_error ivas_binaural_reverb_init( REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ @@ -1876,9 +1877,8 @@ ivas_error ivas_binaural_reverb_init( const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ - const float *defaultEne /* i : default reverberation energies */ - , - float *earlyEne /* i/o: Early part energies to be modified */ + const float *defaultEne, /* i : default reverberation energies */ + float *earlyEne /* i/o: Early part energies to be modified */ ) { ivas_error error; @@ -1899,7 +1899,11 @@ ivas_error ivas_binaural_reverb_init( } else { +#ifdef FIX_1995_REVERB_INIT + for ( bin = 0; bin < numBins; bin++ ) +#else for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) +#endif { revTimes[bin] = defaultTimes[bin]; revEne[bin] = defaultEne[bin]; @@ -1907,7 +1911,11 @@ ivas_error ivas_binaural_reverb_init( preDelay = 10; } +#ifdef FIX_1995_REVERB_INIT + for ( bin = 0; bin < numBins; bin++ ) +#else for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) +#endif { /* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid spectral artefacts with the synthetic reverberator. */