Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/file.c')
-rw-r--r--libavutil/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/file.c b/libavutil/file.c
index ed6fa38b9c..0704080c5b 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -47,6 +47,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
av_unused void *ptr;
off_t off_size;
char errbuf[128];
+ size_t max_size = HAVE_MMAP ? SIZE_MAX : FF_INTERNAL_MEM_TYPE_MAX_VALUE;
*bufptr = NULL;
if (fd < 0) {
@@ -65,7 +66,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
}
off_size = st.st_size;
- if (off_size > SIZE_MAX) {
+ if (off_size > max_size) {
av_log(&file_log_ctx, AV_LOG_ERROR,
"File size for file '%s' is too big\n", filename);
close(fd);