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

init pointer array regardless of having samples to flush or not

parent 0c62f531
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,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 */

/* #################### End BE switches ################################## */

+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
    DECODER_TC_BUFFER_HANDLE hTcBuffer;
    float *p_output[MAX_LS_CHANNELS + MAX_NUM_OBJECTS];

@@ -1416,6 +1419,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;

@@ -1432,8 +1442,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_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ )
        {
@@ -1453,10 +1465,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 )
        {