Commit a600c707 authored by norvell's avatar norvell
Browse files

Fix for null pointer access

parent 82516ccb
Loading
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -699,10 +699,6 @@ ivas_error ivas_td_binaural_open_ext(
    float *distAtt = NULL;
    float *directivity = NULL;

#ifdef NONBE_1377_REND_DIRATT_CONF
    ism_number = id & 0x00FF; /* Exctract ISM number from ID */
#endif

    if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
        if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_transport ) ) != IVAS_ERR_OK )
@@ -729,15 +725,16 @@ ivas_error ivas_td_binaural_open_ext(

    if ( NULL != hRendCfg )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        ism_number = id & 0x00FF; /* Exctract ISM number from ID */
        directivity = hRendCfg->directivity + 3 * ism_number;
#else
        directivity = hRendCfg->directivity;
#endif
        distAtt = hRendCfg->distAtt;
    }

#ifdef NONBE_1377_REND_DIRATT_CONF
    return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity + 3 * ism_number, distAtt, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#else
    return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, distAtt, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#endif
}