diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-05-07 10:00:03 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-05-07 10:34:55 +0200 |
commit | 314374e57978bd215ae42d5444f0e76f2bebdc27 (patch) | |
tree | e8c45be8441b5a02724c85bfb238e816252734a7 | |
parent | f44967b1b548413830324f6c64f78032f9cbecc3 (diff) | |
download | ffmpeg-streaming-314374e57978bd215ae42d5444f0e76f2bebdc27.zip ffmpeg-streaming-314374e57978bd215ae42d5444f0e76f2bebdc27.tar.gz |
Use MAP_FAILED to check for mmap failure instead of manually
recreating the value.
-rw-r--r-- | libavutil/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/file.c b/libavutil/file.c index 1fb7a2b..ed6fa38 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); |