From 86c77a4810f6dd079175eb80d5327827effaebfa Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 7 May 2026 21:22:59 +0200 Subject: [PATCH] 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 --- daemon/sdp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 9716e5a29..1e122d8fa 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2419,7 +2419,7 @@ static void insert_candidate(GString *s, stream_fd *sfd, if (__attr_append_str(&state, &ifa->ice_foundation)) return; - if (local_pref == -1) + if (local_pref == UINT_MAX) local_pref = ifa->unique_id; 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; insert_candidate(s, sfd, type_pref, local_pref, type, flags, ps->media); - if (local_pref != -1) + if (local_pref != UINT_MAX) 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); else { type_pref = ice_type_preference(cand_type); - local_pref = -1; + local_pref = UINT_MAX; } ag = media->ice_agent;