mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
lavf/udp: do not return an uninitialized value from udp_open()
This commit is contained in:
parent
bbf00916e4
commit
3c2b674468
@ -739,8 +739,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
|
|||||||
/* XXX: fix av_url_split */
|
/* XXX: fix av_url_split */
|
||||||
if (hostname[0] == '\0' || hostname[0] == '?') {
|
if (hostname[0] == '\0' || hostname[0] == '?') {
|
||||||
/* only accepts null hostname if input */
|
/* only accepts null hostname if input */
|
||||||
if (!(flags & AVIO_FLAG_READ))
|
if (!(flags & AVIO_FLAG_READ)) {
|
||||||
|
ret = AVERROR(EINVAL);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((ret = ff_udp_set_remote_url(h, uri)) < 0)
|
if ((ret = ff_udp_set_remote_url(h, uri)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -750,8 +752,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
|
|||||||
s->local_port = port;
|
s->local_port = port;
|
||||||
|
|
||||||
udp_fd = udp_socket_create(h, &my_addr, &len, s->localaddr);
|
udp_fd = udp_socket_create(h, &my_addr, &len, s->localaddr);
|
||||||
if (udp_fd < 0)
|
if (udp_fd < 0) {
|
||||||
|
ret = AVERROR(EIO);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
s->local_addr_storage=my_addr; //store for future multicast join
|
s->local_addr_storage=my_addr; //store for future multicast join
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user