]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/udp.c
udp: Fix local_port management
[ffmpeg] / libavformat / udp.c
index dfc3b5aaab86a664dfaf3eb59ba02432b97a7e0a..04e60e3793c6d9a449c177a087cfc29edc9cc40f 100644 (file)
@@ -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])