diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-10-13 11:06:30 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-10-13 12:20:25 +0300 |
commit | 9c412b6e2d4d5ae3c0cbd4a8d0249a3c12c6bd65 (patch) | |
tree | 8d3330c231ce90365593cafd15dd8df281bcc2a8 /intern | |
parent | 3021babf38f88a7e8099189ffa84addf84430dfe (diff) |
Fix possible integer overflow in Cycles baking
Ensure math happens on size_t type instead of int followed by a cast
to the size_t.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/integrator/pass_accessor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/integrator/pass_accessor.cpp b/intern/cycles/integrator/pass_accessor.cpp index 4f76f1fa9df..4a0b1ed6ece 100644 --- a/intern/cycles/integrator/pass_accessor.cpp +++ b/intern/cycles/integrator/pass_accessor.cpp @@ -96,7 +96,7 @@ static void pad_pixels(const BufferParams &buffer_params, return; } - const size_t size = buffer_params.width * buffer_params.height; + const size_t size = static_cast<size_t>(buffer_params.width) * buffer_params.height; if (destination.pixels) { float *pixel = destination.pixels; |