FS-11412: [core] Fix crash caused by missing or malformed ice candidates in sdp
This commit is contained in:
parent
a747db947c
commit
9927baa7d8
|
@ -4257,7 +4257,7 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
|
|||
|
||||
for (ai = 0; ai < engine->cand_acl_count; ai++) {
|
||||
for (i = 0; i < engine->ice_in.cand_idx[cid]; i++) {
|
||||
int is_relay = !strcmp(engine->ice_in.cands[i][cid].cand_type, "relay");
|
||||
int is_relay = engine->ice_in.cands[i][cid].cand_type && !strcmp(engine->ice_in.cands[i][cid].cand_type, "relay");
|
||||
|
||||
if (relay_ok != is_relay) continue;
|
||||
|
||||
|
|
|
@ -1263,7 +1263,8 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
|
|||
}
|
||||
|
||||
|
||||
if (!strcasecmp(ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type, "relay")) {
|
||||
if (ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type &&
|
||||
!strcasecmp(ice->ice_params->cands[ice->ice_params->chosen[ice->proto]][ice->proto].cand_type, "relay")) {
|
||||
do_adj++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue