[Bf-blender-cvs] [f179637222d] master: Fix T95042: Rendering high-res image in Cycles crashes

Sergey Sharybin noreply at git.blender.org
Wed Jan 19 16:03:32 CET 2022


Commit: f179637222d1432b09c3c23201e1b7b75215b11a
Author: Sergey Sharybin
Date:   Wed Jan 19 16:01:41 2022 +0100
Branches: master
https://developer.blender.org/rBf179637222d1432b09c3c23201e1b7b75215b11a

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!

===================================================================

M	intern/cycles/blender/output_driver.cpp

===================================================================

diff --git a/intern/cycles/blender/output_driver.cpp b/intern/cycles/blender/output_driver.cpp
index 7b253e4cd3e..d5cc0c60bae 100644
--- a/intern/cycles/blender/output_driver.cpp
+++ b/intern/cycles/blender/output_driver.cpp
@@ -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) {



More information about the Bf-blender-cvs mailing list