diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-09-23 18:38:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-09-23 18:48:16 +0300 |
commit | d7f803f522237be41c6ede50dde38b3d6795b161 (patch) | |
tree | 43f3c3a7a2e4a9301685e2bc88603467f6bfd243 /intern/cycles/device/device_memory.cpp | |
parent | 6279efbb78a3c701547b8e25cf90efd712c377d0 (diff) |
Fix T91641: crash rendering with 16k environment map in Cycles
Protect against integer overflow.
Diffstat (limited to 'intern/cycles/device/device_memory.cpp')
-rw-r--r-- | intern/cycles/device/device_memory.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/device/device_memory.cpp b/intern/cycles/device/device_memory.cpp index c4d45829b83..c0ab2e17cae 100644 --- a/intern/cycles/device/device_memory.cpp +++ b/intern/cycles/device/device_memory.cpp @@ -136,7 +136,7 @@ void device_memory::device_copy_to() } } -void device_memory::device_copy_from(int y, int w, int h, int elem) +void device_memory::device_copy_from(size_t y, size_t w, size_t h, size_t elem) { assert(type != MEM_TEXTURE && type != MEM_READ_ONLY && type != MEM_GLOBAL); device->mem_copy_from(*this, y, w, h, elem); @@ -181,7 +181,7 @@ bool device_memory::is_resident(Device *sub_device) const /* Device Sub Ptr */ -device_sub_ptr::device_sub_ptr(device_memory &mem, int offset, int size) : device(mem.device) +device_sub_ptr::device_sub_ptr(device_memory &mem, size_t offset, size_t size) : device(mem.device) { ptr = device->mem_alloc_sub_ptr(mem, offset, size); } |