From b1663d2cc60dd82a7db4f7412dd0cc22dde2ab40 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 3 Feb 2014 10:44:50 +0100 Subject: [PATCH] fix potential crash in linphone_call_enable_camera() --- coreapi/linphonecall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 20208eea7..87189d7f8 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1100,7 +1100,8 @@ LinphoneCall *linphone_call_get_replaced_call(LinphoneCall *call){ **/ void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){ #ifdef VIDEO_ENABLED - if (call->videostream!=NULL && call->videostream->ms.ticker!=NULL){ + if ((call->state==LinphoneCallStreamsRunning || call->state==LinphoneCallOutgoingEarlyMedia || call->state==LinphoneCallIncomingEarlyMedia) + && call->videostream!=NULL ){ LinphoneCore *lc=call->core; MSWebCam *nowebcam=get_nowebcam_device(); if (call->camera_enabled!=enable && lc->video_conf.device!=nowebcam){