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.
This commit is contained in:
Sergey Sharybin 2021-10-13 10:06:30 +02:00
parent 3021babf38
commit 9c412b6e2d
1 changed files with 1 additions and 1 deletions

View File

@ -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;