[FFmpeg-devel] [PATCH] os_support: fix poll() implementation

Ronald S. Bultje rsbultje
Tue Feb 15 18:15:01 CET 2011


Hi,

On Tue, Feb 15, 2011 at 12:12 PM, Luca Barbato <lu_zero at gentoo.org> wrote:
> From: Max Shakhmetov <shakhmetov.max at gmail.com>
>
> Our poll implementation does not iterate over the pollfd array properly
> while setting the revents.
>
> Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> ---
> ?libavformat/os_support.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavformat/os_support.c b/libavformat/os_support.c
> index 4f73011..0b7b59e 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;
> --
> 1.7.2.2

OK.

Ronald



More information about the ffmpeg-devel mailing list