MT#61856 sdp.c: use the `UINT_MAX` explicitly

Comparing the `unsigned int` against -1 leads
to comparison of the maximum value representable by unsigned int
(UINT_MAX).

Use explicitly the `UINT_MAX` instead.

Change-Id: Ib1e435c25d481ae680fd3d3f3cb74ec1c7d6109d
pull/1126/merge
Donat Zenichev 1 week ago
parent 1d9b45c805
commit 86c77a4810

@ -2419,7 +2419,7 @@ static void insert_candidate(GString *s, stream_fd *sfd,
if (__attr_append_str(&state, &ifa->ice_foundation)) if (__attr_append_str(&state, &ifa->ice_foundation))
return; return;
if (local_pref == -1) if (local_pref == UINT_MAX)
local_pref = ifa->unique_id; local_pref = ifa->unique_id;
priority = ice_priority_pref(type_pref, local_pref, ps->component); priority = ice_priority_pref(type_pref, local_pref, ps->component);
@ -2452,7 +2452,7 @@ static void insert_sfd_candidates(GString *s, struct packet_stream *ps,
stream_fd *sfd = l->data; stream_fd *sfd = l->data;
insert_candidate(s, sfd, type_pref, local_pref, type, flags, ps->media); insert_candidate(s, sfd, type_pref, local_pref, type, flags, ps->media);
if (local_pref != -1) if (local_pref != UINT_MAX)
local_pref++; local_pref++;
} }
} }
@ -2495,7 +2495,7 @@ static void insert_candidates(GString *s, struct packet_stream *rtp, struct pack
new_priority(source_media, cand_type, &type_pref, &local_pref); new_priority(source_media, cand_type, &type_pref, &local_pref);
else { else {
type_pref = ice_type_preference(cand_type); type_pref = ice_type_preference(cand_type);
local_pref = -1; local_pref = UINT_MAX;
} }
ag = media->ice_agent; ag = media->ice_agent;

Loading…
Cancel
Save