From 98cfcb39f9d0e215efe1c53fbf4ab07dc067b458 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 16 Aug 2012 10:59:14 +0200 Subject: [PATCH] Better loop ending test. --- coreapi/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/misc.c b/coreapi/misc.c index 3d3cb4477..4292a6f17 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -647,7 +647,7 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription * stream->ice_mismatch = ice_check_list_is_mismatch(cl); if ((cl->state == ICL_Running) || (cl->state == ICL_Completed)) { memset(stream->ice_candidates, 0, sizeof(stream->ice_candidates)); - for (j = 0; j < ms_list_size(cl->local_candidates); j++) { + for (j = 0; j < MIN(ms_list_size(cl->local_candidates), SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES); j++) { SalIceCandidate *sal_candidate = &stream->ice_candidates[nb_candidates]; IceCandidate *ice_candidate = ms_list_nth_data(cl->local_candidates, j); const char *default_addr = NULL;