From 9c412b6e2d4d5ae3c0cbd4a8d0249a3c12c6bd65 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 Oct 2021 10:06:30 +0200 Subject: 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. --- intern/cycles/integrator/pass_accessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'intern/cycles/integrator') 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(buffer_params.width) * buffer_params.height; if (destination.pixels) { float *pixel = destination.pixels; -- cgit v1.2.3