aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-09 20:47:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-09 20:58:11 +0200
commit71288bf80f37bdc0795396930d8b97c781c94587 (patch)
tree3e502a3e068ec8fe330b3a26be240400359d0cff /libavformat/tcp.c
parent7ef59803e80952ae9392d86c85f1fcf408cdfcd2 (diff)
parent27852f2f1dec3749ea79883b70484c841169f747 (diff)
downloadffmpeg-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/tcp.c')
-rw-r--r--libavformat/tcp.c6
1 files changed, 3 insertions, 3 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) {