summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-06-01 23:30:16 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-06-11 23:56:31 +0200
commit5683de00e99e4be87419a97d521887f94acc937a (patch)
tree53b241816755baf5e4dfce06c0e1caf859eec7ad /libavutil
parent4299fd23d3f6cbd8f74be4d1eca0c3e3f46d23be (diff)
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.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/error.c b/libavutil/error.c
index 78bceb4b07..0a3b4bfafd 100644
--- a/libavutil/error.c
+++ b/libavutil/error.c
@@ -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