aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/file.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-05-07 10:00:03 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-05-07 10:34:55 +0200
commit314374e57978bd215ae42d5444f0e76f2bebdc27 (patch)
treee8c45be8441b5a02724c85bfb238e816252734a7 /libavutil/file.c
parentf44967b1b548413830324f6c64f78032f9cbecc3 (diff)
downloadffmpeg-314374e57978bd215ae42d5444f0e76f2bebdc27.tar.gz
Use MAP_FAILED to check for mmap failure instead of manually
recreating the value.
Diffstat (limited to 'libavutil/file.c')
-rw-r--r--libavutil/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/file.c b/libavutil/file.c
index 1fb7a2b5c9..ed6fa38b9c 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -75,7 +75,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
#if HAVE_MMAP
ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
- if (ptr == (void*)-1) {
+ if (ptr == MAP_FAILED) {
err = AVERROR(errno);
av_strerror(err, errbuf, sizeof(errbuf));
av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf);