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/cuda/device_impl.cpp | |
parent | 6279efbb78a3c701547b8e25cf90efd712c377d0 (diff) |
Fix T91641: crash rendering with 16k environment map in Cycles
Protect against integer overflow.
Diffstat (limited to 'intern/cycles/device/cuda/device_impl.cpp')
-rw-r--r-- | intern/cycles/device/cuda/device_impl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/device/cuda/device_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp index 37fab8f8293..0f10119e24f 100644 --- a/intern/cycles/device/cuda/device_impl.cpp +++ b/intern/cycles/device/cuda/device_impl.cpp @@ -837,7 +837,7 @@ void CUDADevice::mem_copy_to(device_memory &mem) } } -void CUDADevice::mem_copy_from(device_memory &mem, int y, int w, int h, int elem) +void CUDADevice::mem_copy_from(device_memory &mem, size_t y, size_t w, size_t h, size_t elem) { if (mem.type == MEM_TEXTURE || mem.type == MEM_GLOBAL) { assert(!"mem_copy_from not supported for textures."); @@ -891,7 +891,7 @@ void CUDADevice::mem_free(device_memory &mem) } } -device_ptr CUDADevice::mem_alloc_sub_ptr(device_memory &mem, int offset, int /*size*/) +device_ptr CUDADevice::mem_alloc_sub_ptr(device_memory &mem, size_t offset, size_t /*size*/) { return (device_ptr)(((char *)mem.device_pointer) + mem.memory_elements_size(offset)); } |