Commit 259d99f1 authored by sagnowski's avatar sagnowski
Browse files

Initialize decoder struct earlier to avoid unititalized pointers

parent 4a8913d7
Loading
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ ivas_error IVAS_DEC_Open(
    float no_diegetic_pan )
{
    IVAS_DEC_HANDLE hIvasDec;
#ifdef FIX_I98_HANDLES_TO_NULL
    ivas_error error;
#endif

    if ( phIvasDec == NULL )
    {
@@ -146,7 +149,13 @@ ivas_error IVAS_DEC_Open(
    hIvasDec->prev_ft_speech = 1; /* RXDTX handeler previous frametype flag for G.192 format AMRWB SID_FIRST detection */
    hIvasDec->CNG = 0;            /* RXDTX handler CNG = 1, no CNG = 0*/

#ifndef FIX_I98_HANDLES_TO_NULL
#ifdef FIX_I98_HANDLES_TO_NULL
    /* Set decoder parameters to initial values */
    if ( ( error = ivas_init_decoder_front( hIvasDec->st_ivas ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
    /* initialize pointers to handles */
    ivas_initialize_handles_dec( hIvasDec->st_ivas );
#endif
@@ -455,11 +464,13 @@ ivas_error IVAS_DEC_Configure(
    hDecoderConfig->Opt_Headrotation = enableHeadRotation;
    hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled;

#ifndef FIX_I98_HANDLES_TO_NULL
    /* Set decoder parameters to initial values */
    if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#endif

    if ( hIvasDec->mode == IVAS_DEC_MODE_EVS )
    {