Skip to content

Commit 71288bf

Browse files
committed
Merge commit '27852f2f1dec3749ea79883b70484c841169f747'
* commit '27852f2f1dec3749ea79883b70484c841169f747': libavformat: Handle error return from ff_listen_bind Merged-by: Michael Niedermayer <[email protected]>
2 parents 7ef5980 + 27852f2 commit 71288bf

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

libavformat/tcp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
126126
}
127127

128128
if (s->listen) {
129-
if ((fd = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
130-
s->listen_timeout, h)) < 0) {
131-
ret = fd;
129+
if ((ret = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
130+
s->listen_timeout, h)) < 0) {
132131
goto fail1;
133132
}
133+
fd = ret;
134134
} else {
135135
if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
136136
s->open_timeout / 1000, h, !!cur_ai->ai_next)) < 0) {

libavformat/unix.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,11 @@ static int unix_open(URLContext *h, const char *filename, int flags)
7474
return ff_neterrno();
7575

7676
if (s->listen) {
77-
fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
78-
sizeof(s->addr), s->timeout, h);
79-
if (fd < 0) {
80-
ret = fd;
77+
ret = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
78+
sizeof(s->addr), s->timeout, h);
79+
if (ret < 0)
8180
goto fail;
82-
}
81+
fd = ret;
8382
} else {
8483
ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,
8584
sizeof(s->addr), s->timeout, h, 0);

0 commit comments

Comments
 (0)