Commit: d84c55f0fa4775f68af4ae7beba3fbeec4a98593
Author: Sergey Sharybin
Date:   Thu Sep 22 17:30:31 2016 +0200
Branches: master
https://developer.blender.org/rBd84c55f0fa4775f68af4ae7beba3fbeec4a98593

Fix T49417: Cycles crash - can't use 5 Gigabyte Tile EXR texture file

Was an integer overflow issue when calculating offsets.

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

M       intern/cycles/render/image.cpp

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

diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index b387c2c..7e24664 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -587,8 +587,7 @@ bool ImageManager::file_load_float_image(Image *img, 
ImageDataType type, device_
                }
 
                if(depth <= 1) {
-                       int scanlinesize = width*components*sizeof(float);
-
+                       size_t scanlinesize = 
((size_t)width)*components*sizeof(float);
                        in->read_image(TypeDesc::FLOAT,
                                       (uchar*)readpixels + 
(height-1)*scanlinesize,
                                       AutoStride,
@@ -696,8 +695,7 @@ bool ImageManager::file_load_half_image(Image *img, 
ImageDataType type, device_v
                }
 
                if(depth <= 1) {
-                       int scanlinesize = width*components*sizeof(half);
-
+                       size_t scanlinesize = 
((size_t)width)*components*sizeof(half);
                        in->read_image(TypeDesc::HALF,
                                       (uchar*)readpixels + 
(height-1)*scanlinesize,
                                       AutoStride,

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to