fix potential crash in linphone_call_enable_camera()

This commit is contained in:
Simon Morlat 2014-02-03 10:44:50 +01:00
parent ba06368167
commit b1663d2cc6

View file

@ -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){