diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-09 20:47:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-09 20:58:11 +0200 |
commit | 71288bf80f37bdc0795396930d8b97c781c94587 (patch) | |
tree | 3e502a3e068ec8fe330b3a26be240400359d0cff /libavformat | |
parent | 7ef59803e80952ae9392d86c85f1fcf408cdfcd2 (diff) | |
parent | 27852f2f1dec3749ea79883b70484c841169f747 (diff) | |
download | ffmpeg-71288bf80f37bdc0795396930d8b97c781c94587.tar.gz |
Merge commit '27852f2f1dec3749ea79883b70484c841169f747'
* commit '27852f2f1dec3749ea79883b70484c841169f747':
libavformat: Handle error return from ff_listen_bind
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/tcp.c | 6 | ||||
-rw-r--r-- | libavformat/unix.c | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 4016c0e1ac..f24cad2080 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -126,11 +126,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags) } if (s->listen) { - if ((fd = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen, - s->listen_timeout, h)) < 0) { - ret = fd; + if ((ret = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen, + s->listen_timeout, h)) < 0) { goto fail1; } + fd = ret; } else { if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen, s->open_timeout / 1000, h, !!cur_ai->ai_next)) < 0) { diff --git a/libavformat/unix.c b/libavformat/unix.c index 397706528a..63d1db248f 100644 --- a/libavformat/unix.c +++ b/libavformat/unix.c @@ -74,12 +74,11 @@ static int unix_open(URLContext *h, const char *filename, int flags) return ff_neterrno(); if (s->listen) { - fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr, - sizeof(s->addr), s->timeout, h); - if (fd < 0) { - ret = fd; + ret = ff_listen_bind(fd, (struct sockaddr *)&s->addr, + sizeof(s->addr), s->timeout, h); + if (ret < 0) goto fail; - } + fd = ret; } else { ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr, sizeof(s->addr), s->timeout, h, 0); |