summaryrefslogtreecommitdiff
path: root/libavutil/file.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-06-04 13:36:35 +0100
committerMans Rullgard <mans@mansr.com>2011-06-04 17:03:25 +0100
commitd0989bed226578a8f37ca90c78abc97abafb9794 (patch)
tree85fa6e0d1b53c6a5e2b199bde45a261114c365d3 /libavutil/file.c
parentdc6632f1195c929a87ddf1b02d12b681c6de79ad (diff)
downloadffmpeg-d0989bed226578a8f37ca90c78abc97abafb9794.tar.gz
Fix error check in av_file_map()
On failure, mmap() returns MAP_FAILED, which may or may not be -1. Signed-off-by: Mans Rullgard <mans@mansr.com>
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 3dcce7c2f8..f0e48b5b2f 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 ((int)(ptr) == -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);