mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
avformat/udp: avoid warning about always false comparison
socklen_t underlying type can be signed or unsigned depending on
platform. This is fine, just cast it to size_t before comparison.
Fixes: warning: result of comparison of unsigned expression < 0 is
always false [-Wtautological-unsigned-zero-compare]
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
@@ -473,7 +473,7 @@ int ff_udp_set_remote_addr(URLContext *h, const struct sockaddr *dest_addr, sock
|
||||
UDPContext *s = h->priv_data;
|
||||
|
||||
/* set the destination address */
|
||||
if (dest_addr_len < 0 || dest_addr_len > sizeof(s->dest_addr))
|
||||
if ((size_t)dest_addr_len > sizeof(s->dest_addr))
|
||||
return AVERROR(EIO);
|
||||
s->dest_addr_len = dest_addr_len;
|
||||
memcpy(&s->dest_addr, dest_addr, dest_addr_len);
|
||||
|
||||
Reference in New Issue
Block a user