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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-11-06 19:16:46 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-11-06 19:16:46 +0300
commit64cd9a079b987e1ef3daf926bd5af26185e297a5 (patch)
treec97765e392afd910473c8a8fe6a39ca675529c73 /intern/guardedalloc
parent65b414cfb291e8ae47e92ab1b101de3fa6d19704 (diff)
Fix T70952: EXR files bigger than 2GB don't open on Windows
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r--intern/guardedalloc/intern/mmap_win.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/guardedalloc/intern/mmap_win.c b/intern/guardedalloc/intern/mmap_win.c
index 5b0c4b6614a..3508ae4e1aa 100644
--- a/intern/guardedalloc/intern/mmap_win.c
+++ b/intern/guardedalloc/intern/mmap_win.c
@@ -125,8 +125,11 @@ void *mmap(void *UNUSED(start), size_t len, int prot, int flags, int fd, off_t o
}
}
- /* note len is passed to a 32 bit DWORD, so can't be > 4 GB */
- maphandle = CreateFileMapping(fhandle, NULL, prot_flags, 0, len, NULL);
+ /* Split 64 bit size into low and high bits. */
+ DWORD len_bits_high = len >> 32;
+ DWORD len_bits_low = len & 0xFFFFFFFF;
+
+ maphandle = CreateFileMapping(fhandle, NULL, prot_flags, len_bits_high, len_bits_low, NULL);
if (maphandle == 0) {
errno = EBADF;
return MAP_FAILED;