From a41aebf1535da0cb2b2e64e060d50cad73e0b1fa Mon Sep 17 00:00:00 2001
From: Max Shakhmetov <shakhmetov.max@gmail.com>
Date: Tue, 15 Feb 2011 17:49:27 +0100
Subject: [PATCH] os_support: fix poll() implementation

Our poll implementation does not iterate over the pollfd array properly
while setting the revents.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 9ac2085dbf1821b7995fe360038c1bf0f3940032)
---
 libavformat/os_support.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 4f73011d65f..0b7b59e77d3 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -292,7 +292,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
     if (rc < 0)
         return rc;
 
-    for(i = 0; i < (nfds_t) n; i++) {
+    for(i = 0; i < numfds; i++) {
         fds[i].revents = 0;
 
         if (FD_ISSET(fds[i].fd, &read_set))      fds[i].revents |= POLLIN;
-- 
GitLab