Fix T95042: Rendering high-res image in Cycles crashes

Integer overflow when the final frame is handled by the Blender's
output driver.

Thanks Jesse and Thomas for investigation!
This commit is contained in:
Sergey Sharybin 2022-01-19 16:01:41 +01:00
parent ecf2f5ed01
commit f179637222
Notes: blender-bot 2023-02-14 08:42:54 +01:00
Referenced by issue #95042, 2022.1.19 Rendering 30000x24000 crash after denoise  finish
Referenced by issue #95025, Cycles crash at the end of the render
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ bool BlenderOutputDriver::read_render_tile(const Tile &tile)
BL::RenderLayer b_rlay = *b_single_rlay;
vector<float> pixels(tile.size.x * tile.size.y * 4);
vector<float> pixels(static_cast<size_t>(tile.size.x) * tile.size.y * 4);
/* Copy each pass.
* TODO:copy only the required ones for better performance? */
@ -109,7 +109,7 @@ void BlenderOutputDriver::write_render_tile(const Tile &tile)
BL::RenderLayer b_rlay = *b_single_rlay;
vector<float> pixels(tile.size.x * tile.size.y * 4);
vector<float> pixels(static_cast<size_t>(tile.size.x) * tile.size.y * 4);
/* Copy each pass. */
for (BL::RenderPass &b_pass : b_rlay.passes) {