]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
redo
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 1 Dec 2013 08:53:27 +0000 (02:53 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 1 Dec 2013 08:53:27 +0000 (02:53 -0600)
src/switch_core_media.c

index 80dcec3cc72cdebfdeab5bfbbcfaf774730028d7..cc960c886df25c863683fecde96f94f997c3f2aa 100644 (file)
@@ -2334,10 +2334,8 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_
                        data = switch_core_session_strdup(smh->session, attr->a_value);
 
                        argc = switch_split(data, ' ', fields);
-
-                       engine->ice_in.cand_idx++;
                        
-                       if (argc < 5 || engine->ice_in.cand_idx >= MAX_CAND) {
+                       if (argc < 5 || engine->ice_in.cand_idx >= MAX_CAND - 1) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Invalid data\n");
                                continue;
                        }
@@ -2353,6 +2351,8 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_
                                                          "Checking Candidate cid: %d proto: %s type: %s addr: %s:%s\n", cid+1, fields[2], fields[7], fields[4], fields[5]);
 
 
+                       engine->ice_in.cand_idx++;
+
                        for (i = 0; i < engine->cand_acl_count; i++) {
                                if (!engine->ice_in.chosen[cid] && switch_check_network_list_ip(fields[4], engine->cand_acl[i])) {
                                        engine->ice_in.chosen[cid] = engine->ice_in.cand_idx;