udp: Fix local_port management

The default value for unset is -1, not 0.

Problem introduced in 66028b7ba6
This commit is contained in:
Luca Barbato 2015-03-29 15:19:35 +02:00
parent 8655c54160
commit 61dc9d647c
1 changed files with 1 additions and 1 deletions

View 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])