aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorJordi Ortiz <nenjordi@gmail.com>2012-06-16 12:29:53 +0200
committerMartin Storsjö <martin@martin.st>2012-06-17 13:22:36 +0300
commita7cc78cb11dfdd356d83a2bdbb00eb92c1367379 (patch)
treeb770d7232270ad523dd27f1d05aa9d7f71989a9c /libavformat/tcp.c
parentae702edf438c67ea5ad257a6779f68900edd88c9 (diff)
downloadffmpeg-a7cc78cb11dfdd356d83a2bdbb00eb92c1367379.tar.gz
tcp: Check the listen call
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index a6eeeb0d0f..7e348f7729 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -90,7 +90,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
ret = ff_neterrno();
goto fail1;
}
- listen(fd, 1);
+ ret = listen(fd, 1);
+ if (ret) {
+ ret = ff_neterrno();
+ goto fail1;
+ }
fd1 = accept(fd, NULL, NULL);
if (fd1 < 0) {
ret = ff_neterrno();