Skip to content
Commits on Source (2)
  • vaclav's avatar
    fix FIX_1995_REVERB_INIT · acaec886
    vaclav authored
    acaec886
  • vaclav's avatar
    Merge branch... · a9428e06
    vaclav authored
    Merge branch '1995-msan-use-of-uninitialized-value-ivas_binaural_reverb_init-FLP' into 'ivas-float-update'
    
    Fix use-of-uninitialized-value in ivas_binaural_reverb_init() to FLP-ref
    
    See merge request !2203
    a9428e06
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
/* #################### End FIXES switches ############################ */ /* #################### End FIXES switches ############################ */
#define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #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 ############################ */ /* #################### Start BASOP porting switches ############################ */
......
...@@ -1868,6 +1868,7 @@ static ivas_error ivas_binaural_reverb_open( ...@@ -1868,6 +1868,7 @@ static ivas_error ivas_binaural_reverb_open(
* Allocate and initialize binaural room reverberator handle * Allocate and initialize binaural room reverberator handle
* for CLDFB renderers * for CLDFB renderers
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
ivas_error ivas_binaural_reverb_init( ivas_error ivas_binaural_reverb_init(
REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */
const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */
...@@ -1876,8 +1877,7 @@ ivas_error ivas_binaural_reverb_init( ...@@ -1876,8 +1877,7 @@ ivas_error ivas_binaural_reverb_init(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */
const int32_t sampling_rate, /* i : sampling rate */ const int32_t sampling_rate, /* i : sampling rate */
const float *defaultTimes, /* i : default reverberation times */ const float *defaultTimes, /* i : default reverberation times */
const float *defaultEne /* i : default reverberation energies */ const float *defaultEne, /* i : default reverberation energies */
,
float *earlyEne /* i/o: Early part energies to be modified */ float *earlyEne /* i/o: Early part energies to be modified */
) )
{ {
...@@ -1899,7 +1899,11 @@ ivas_error ivas_binaural_reverb_init( ...@@ -1899,7 +1899,11 @@ ivas_error ivas_binaural_reverb_init(
} }
else else
{ {
#ifdef FIX_1995_REVERB_INIT
for ( bin = 0; bin < numBins; bin++ )
#else
for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{ {
revTimes[bin] = defaultTimes[bin]; revTimes[bin] = defaultTimes[bin];
revEne[bin] = defaultEne[bin]; revEne[bin] = defaultEne[bin];
...@@ -1907,7 +1911,11 @@ ivas_error ivas_binaural_reverb_init( ...@@ -1907,7 +1911,11 @@ ivas_error ivas_binaural_reverb_init(
preDelay = 10; preDelay = 10;
} }
#ifdef FIX_1995_REVERB_INIT
for ( bin = 0; bin < numBins; bin++ )
#else
for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) 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 /* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid
spectral artefacts with the synthetic reverberator. */ spectral artefacts with the synthetic reverberator. */
......