linphonecall.c: fix crash in zrtp

This commit is contained in:
Gautier Pelloux-Prayer 2016-02-11 16:44:04 +01:00
parent 1b7f53849d
commit da9c8393fc

View file

@ -243,11 +243,13 @@ static void linphone_call_audiostream_auth_token_ready(void *data, const char* a
* @ingroup call_control
**/
void linphone_call_set_authentication_token_verified(LinphoneCall *call, bool_t verified){
if (call->audiostream==NULL){
ms_error("linphone_call_set_authentication_token_verified(): No audio stream");
if (call->audiostream==NULL || !media_stream_started(&call->audiostream->ms)){
ms_error("linphone_call_set_authentication_token_verified(): No audio stream or not started");
return;
}
if (call->audiostream->ms.sessions.zrtp_context==NULL){
ms_error("linphone_call_set_authentication_token_verified(): No zrtp context.");
return;
}
if (!call->auth_token_verified && verified){
ms_zrtp_sas_verified(call->audiostream->ms.sessions.zrtp_context);