diff --git a/libavformat/udp.c b/libavformat/udp.c index dfc3b5aaab..04e60e3793 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -519,7 +519,7 @@ static int udp_open(URLContext *h, const char *uri, int flags) goto fail; } - if ((s->is_multicast || !s->local_port) && (h->flags & AVIO_FLAG_READ)) + if ((s->is_multicast || s->local_port < 0) && (h->flags & AVIO_FLAG_READ)) s->local_port = port; if (localaddr[0])