Commit b2226e4a authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] sanitizer errors due to multiple calls to ISAR_PRE_REND_Open()

parent 62a12c78
Loading
Loading
Loading
Loading
Loading
+29 −21
Original line number Diff line number Diff line
@@ -3645,7 +3645,14 @@ static ivas_error isar_pre_rend_init(

    realloc = false;

    if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    /* only perform init if split rendering output */
    if ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        return IVAS_ERR_OK;
    }

    /* these function should only be called once during initial allocation */
    if ( pSplitRendEncBuffer->data == NULL )
    {
        if ( pSplit_rend_config->poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
        {
@@ -3666,9 +3673,11 @@ static ivas_error isar_pre_rend_init(
        {
            return error;
        }
    }


        /* If the cldfb_in_flag is different from what was previously allocated for the buffer, change the size */
    /* We may need to change the allocated buffer size if a new input is added.
     * If the cldfb_in_flag is different from what was previously allocated for the buffer, change the size */
    if ( pSplitRendEncBuffer->data != NULL && ( cldfb_in_flag != pSplitRendEncBuffer->config.is_cldfb ) )
    {
        realloc = true;
@@ -3693,7 +3702,6 @@ static ivas_error isar_pre_rend_init(
            return IVAS_ERR_FAILED_ALLOC;
        }
    }
    }

    return IVAS_ERR_OK;
}