[vlc-devel] [PATCH] access_output: file: fix zero write
Rémi Denis-Courmont
remi at remlab.net
Sun Oct 14 11:17:36 CEST 2018
Le keskiviikkona 10. lokakuuta 2018, 21.45.59 EEST Francois Cartegnie a écrit
:
> ---
> modules/access_output/file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/access_output/file.c b/modules/access_output/file.c
> index da419f2810..e6886c394e 100644
> --- a/modules/access_output/file.c
> +++ b/modules/access_output/file.c
> @@ -84,7 +84,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t
> *p_buffer ) {
> ssize_t val = write ((intptr_t)p_access->p_sys,
> p_buffer->p_buffer, p_buffer->i_buffer);
> - if (val <= 0)
> + if (val < 0 || (val == 0 && p_buffer->i_buffer))
I don't think errno gets set if val is zero, so we may have a bigger problem
here.
> {
> if (errno == EINTR)
> continue;
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list