Browse Source

lavu/error: fix sign error in av_sterror() error code

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 meaningful error message on the buffer.
tags/n1.0
Stefano Sabatini 13 years ago
parent
commit
5683de00e9
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/error.c

+ 1
- 1
libavutil/error.c View File

@@ -61,7 +61,7 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
av_strlcpy(errbuf, entry->str, errbuf_size);
} else {
#if HAVE_STRERROR_R
ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size);
ret = AVERROR(strerror_r(AVUNERROR(errnum), errbuf, errbuf_size));
#else
ret = -1;
#endif


Loading…
Cancel
Save