On 27/08/15 06:04, Sean McGovern wrote:
> Bug-Id: 881
> 
> CC: libav-sta...@libav.org
> ---
>  libavformat/file.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/file.c b/libavformat/file.c
> index 2837e9f..b54db9a 100644
> --- a/libavformat/file.c
> +++ b/libavformat/file.c
> @@ -59,13 +59,15 @@ static const AVClass file_class = {
>  static int file_read(URLContext *h, unsigned char *buf, int size)
>  {
>      FileContext *c = h->priv_data;
> -    return read(c->fd, buf, size);
> +    int ret = read(c->fd, buf, size);
> +    return (ret == -1) ? AVERROR(errno) : ret;
>  }
>  
>  static int file_write(URLContext *h, const unsigned char *buf, int size)
>  {
>      FileContext *c = h->priv_data;
> -    return write(c->fd, buf, size);
> +    int ret = write(c->fd, buf, size);
> +    return (ret == -1) ? AVERROR(errno) : ret;
>  }
>  
>  static int file_get_handle(URLContext *h)
> 

Looks fine to me.
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to