OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a840cdd
)
tcp: Check the return value from getsockopt
author
Martin Storsjö
<martin@martin.st>
Tue, 19 Jun 2012 14:50:38 +0000
(17:50 +0300)
committer
Martin Storsjö
<martin@martin.st>
Tue, 19 Jun 2012 17:25:07 +0000
(20:25 +0300)
Make sure we actually have an error code in ret, in case
getsockopt failed.
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/tcp.c
patch
|
blob
|
history
diff --git
a/libavformat/tcp.c
b/libavformat/tcp.c
index
e7c6210
..
f1bad84
100644
(file)
--- a/
libavformat/tcp.c
+++ b/
libavformat/tcp.c
@@
-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);