Commit bb6c1abb authored by Martin Storsjö's avatar Martin Storsjö

tcp: Check the return value from getsockopt

Make sure we actually have an error code in ret, in case
getsockopt failed.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent a840cdda
......@@ -139,7 +139,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
}
/* test error */
optlen = sizeof(ret);
getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen))
ret = AVUNERROR(ff_neterrno());
if (ret != 0) {
char errbuf[100];
ret = AVERROR(ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment