From 7439475e69f333541c3647f6b9eb5b5af073cb64 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 21 Oct 2013 17:23:35 +0200 Subject: [PATCH] avformat/network: check ff_socket_nonblock() return and print a debug message Fixes CID1026744 Fixes CID1026743 Signed-off-by: Michael Niedermayer --- libavformat/network.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/network.c b/libavformat/network.c index 2ba435d472..5e2bcf8d15 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -281,7 +281,9 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, closesocket(fd); - ff_socket_nonblock(ret, 1); + if (ff_socket_nonblock(ret, 1) < 0) + av_log(NULL, AV_LOG_DEBUG, "ff_socket_nonblock failed\n"); + return ret; } @@ -293,7 +295,8 @@ int ff_listen_connect(int fd, const struct sockaddr *addr, int ret; socklen_t optlen; - ff_socket_nonblock(fd, 1); + if (ff_socket_nonblock(fd, 1) < 0) + av_log(NULL, AV_LOG_DEBUG, "ff_socket_nonblock failed\n"); while ((ret = connect(fd, addr, addrlen))) { ret = ff_neterrno();