[FFmpeg-devel] [PATCH] lavu/error: fix sign error in av_sterror() error code

Stefano Sabatini stefasab at gmail.com
Tue Jun 12 01:19:25 CEST 2012


On date Friday 2012-06-01 23:46:56 +0200, Stefano Sabatini encoded:
> The value returned by strerror_r may be positive depending on the system,
> so it is necessary to use AVERROR() in order to get a negative
> number. This way the successive negative check will not fail, and the
> function will print a correct value on the buffer.
> ---
>  libavutil/error.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavutil/error.c b/libavutil/error.c
> index b1f8be5..16c2587 100644
> --- a/libavutil/error.c
> +++ b/libavutil/error.c
> @@ -64,7 +64,7 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
>  #else
>          ret = -1;
>  #endif
> -        if (ret < 0)
> +        if (AVERROR(ret) < 0)

AVERROR() had to be applied to the return value of strerror_r(),
pushed with that change.
-- 
FFmpeg = Funny & Fast Magnificient Ponderous Earthshaking Gladiator


More information about the ffmpeg-devel mailing list