From 08bff790a6e698e332d0c362f8177209c3a04bd7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 7 Dec 2017 16:29:09 +0100 Subject: [PATCH] fix(core): test if cards is null in get_sound_devices_list (crash in no video mode) --- coreapi/linphonecore.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index bc45e07e2..4d22aec51 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -4218,9 +4218,11 @@ bctbx_list_t * linphone_core_get_sound_devices_list(const LinphoneCore *lc){ bctbx_list_t * linphone_core_get_video_devices_list(const LinphoneCore *lc){ bctbx_list_t *cards_list = NULL; const char** cards = lc->video_conf.cams; - for (const char* c = *cards; c; c=*++cards) { - cards_list = bctbx_list_append(cards_list, (char *)c); - } + + if (cards) + for (const char* c = *cards; c; c=*++cards) + cards_list = bctbx_list_append(cards_list, (char *)c); + return cards_list; }