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

[fix] add proper NULL check for EFAP init

parent 937bfe91
Loading
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -172,11 +172,19 @@ ivas_error efap_init_data(
    error = IVAS_ERR_OK;

    /* Basic init checks */
#ifdef FIX_1574_EFAP_CODE_LINT
    if ( hEFAPdata == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "EFAP handle is NULL" );
    }
    if ( *hEFAPdata != NULL )
    {
        return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "EFAP handle must be NULL before initialization" );
    }
#endif
    if ( !speaker_node_azi_deg || !speaker_node_ele_deg )
    {
#ifdef FIX_1574_EFAP_CODE_LINT
        *hEFAPdata = NULL;
#else
#ifndef FIX_1574_EFAP_CODE_LINT
        hEFAPdata = NULL;
#endif
        return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "EFAP requires arrays of speaker azimuths and elevations" );