mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
tcp: Check the return value from getsockopt
Make sure we actually have an error code in ret, in case getsockopt failed. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
a840cdda6c
commit
bb6c1abb0e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user