diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2022-11-19 02:38:42 +0100 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2022-11-19 02:38:42 +0100 |
commit | 202759472036c8dc865d58450580d31677c74624 (patch) | |
tree | d491368b3b48e7f52103202783af4f2e5e26766c /agent | |
parent | 74657cbc528b1a4b578b117bdea90b8001ed254c (diff) | |
download | libnice-202759472036c8dc865d58450580d31677c74624.tar.gz |
candidate: fix assertions caused by API guards in new address API
The checks were reversed, requiring for instance a non-relay candidate
for calling nice_candidate_relay_address()
Diffstat (limited to 'agent')
-rw-r--r-- | agent/candidate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/candidate.c b/agent/candidate.c index 7659b32..4d18ff7 100644 --- a/agent/candidate.c +++ b/agent/candidate.c @@ -475,7 +475,7 @@ nice_candidate_relay_address (const NiceCandidate *candidate, NiceAddress *addr) const NiceCandidateImpl *c = (NiceCandidateImpl *) candidate; g_return_if_fail (candidate != NULL); - g_return_if_fail (candidate->type != NICE_CANDIDATE_TYPE_RELAYED); + g_return_if_fail (candidate->type == NICE_CANDIDATE_TYPE_RELAYED); *addr = c->turn->server; } @@ -486,7 +486,7 @@ nice_candidate_stun_server_address (const NiceCandidate *candidate, NiceAddress const NiceCandidateImpl *c = (NiceCandidateImpl *) candidate; g_return_val_if_fail (candidate != NULL, FALSE); - g_return_val_if_fail (candidate->type != NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE, FALSE); + g_return_val_if_fail (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE, FALSE); if (c->stun_server) { *addr = *c->stun_server; |