summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2022-11-19 02:38:42 +0100
committerMathieu Duponchelle <mathieu@centricular.com>2022-11-19 02:38:42 +0100
commit202759472036c8dc865d58450580d31677c74624 (patch)
treed491368b3b48e7f52103202783af4f2e5e26766c
parent74657cbc528b1a4b578b117bdea90b8001ed254c (diff)
downloadlibnice-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()
-rw-r--r--agent/candidate.c4
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;