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/unix.c | |
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/unix.c')
-rw-r--r-- | libavformat/unix.c | 9 |
1 files changed, 4 insertions, 5 deletions
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); |