OSDN Git Service
(root)
/
coroid
/
ffmpeg_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc6632f
)
Fix error check in av_file_map()
author
Mans Rullgard
<mans@mansr.com>
Sat, 4 Jun 2011 12:36:35 +0000
(13:36 +0100)
committer
Mans Rullgard
<mans@mansr.com>
Sat, 4 Jun 2011 16:03:25 +0000
(17:03 +0100)
On failure, mmap() returns MAP_FAILED, which may or may not be -1.
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil/file.c
patch
|
blob
|
history
diff --git
a/libavutil/file.c
b/libavutil/file.c
index
3dcce7c
..
f0e48b5
100644
(file)
--- 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);