diff options
author | Alex Beregszaszi | 2007-05-21 16:08:03 +0000 |
---|---|---|
committer | Alex Beregszaszi | 2007-05-21 16:08:03 +0000 |
commit | 3e2e29fb00466189f49e3dd8f4a657289401351c (patch) | |
tree | e0487c8d8de852d79d6489343ae71fcbf7453fd7 /libavformat/os_support.c | |
parent | 7235183df92d1267f8b4a5ac2a73ed4d700163b7 (diff) |
r9095 invalidly removed the check for non-winsock
Originally committed as revision 9096 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r-- | libavformat/os_support.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c index b70dc2755b..ded36d6400 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -139,10 +139,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) int n; int rc; +#ifdef __MINGW32__ if (numfds >= FD_SETSIZE) { errno = EINVAL; return -1; } +#endif FD_ZERO(&read_set); FD_ZERO(&write_set); @@ -152,6 +154,12 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout) for(i = 0; i < numfds; i++) { if (fds[i].fd < 0) continue; +#ifndef __MINGW32__ + if (fds[i].fd >= FD_SETSIZE) { + errno = EINVAL; + return -1; + } +#endif if (fds[i].events & POLLIN) FD_SET(fds[i].fd, &read_set); if (fds[i].events & POLLOUT) FD_SET(fds[i].fd, &write_set); |