Commit fd675060 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch...

Merge branch 'float-1486-clang18-msan-use-of-uninitialized-value-in-lib_com-ivas_tools-c-134-23' into 'main'

Resolve "[CLANG18] MSAN: use-of-uninitialized-value in lib_com/ivas_tools.c:134:23"

See merge request !2469
parents 67cb9095 b048278d
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@
#define FIX_2274_OOB_INDEXING_IN_CORRMATRIX             /* FhG: fix OOB indexing complaint */
#define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */
#define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE       /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */
#define FIX_1486_INIT_OUTPUT_POINTERS                   /* FhG: always initialize pointers in renderer flush */
#define FIX_1474_USAN_TRANS_INV                         /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */
#define FIX_2268_OOB_INDEXING_IN_IFFT                   /* VA: Fix for issue 2268, to silence clang18 */
#define FIX_2271_OOB_INDEXING_IN_PIT_OL2                /* VA: Fix for issue 2271, to silence clang18 */
+14 −0
Original line number Diff line number Diff line
@@ -1408,6 +1408,9 @@ ivas_error ivas_jbm_dec_flush_renderer(
    int16_t n_samples_still_available;
    int16_t n_slots_still_available;
    int16_t n_samples_to_render;
#ifdef FIX_1486_INIT_OUTPUT_POINTERS
    int16_t ch_idx;
#endif
    int16_t n_samples_granularity;
    DECODER_TC_BUFFER_HANDLE hTcBuffer;
    float *p_output[MAX_LS_CHANNELS + MAX_NUM_OBJECTS];
@@ -1417,6 +1420,13 @@ ivas_error ivas_jbm_dec_flush_renderer(
        return IVAS_ERR_OK;
    }

#ifdef FIX_1486_INIT_OUTPUT_POINTERS
    for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ )
    {
        p_output[ch_idx] = st_ivas->p_output_f[ch_idx];
    }
#endif

    *nSamplesRendered = 0;
    hTcBuffer = st_ivas->hTcBuffer;
    n_samples_granularity = hTcBuffer->n_samples_granularity;
@@ -1434,8 +1444,10 @@ ivas_error ivas_jbm_dec_flush_renderer(

    if ( n_slots_still_available )
    {
#ifndef FIX_1486_INIT_OUTPUT_POINTERS
        int16_t ch_idx;

#endif
        /* render available full slots (with new lower granularity) */
        for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_rend, hTcBuffer->nchan_buffer_full ); ch_idx++ )
        {
@@ -1455,10 +1467,12 @@ ivas_error ivas_jbm_dec_flush_renderer(
        hTcBuffer->n_samples_flushed = n_samples_to_render;
        hTcBuffer->n_samples_rendered = 0;

#ifndef FIX_1486_INIT_OUTPUT_POINTERS
        for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ )
        {
            p_output[ch_idx] = st_ivas->p_output_f[ch_idx];
        }
#endif

        if ( st_ivas->ivas_format == ISM_FORMAT )
        {