Commit: b9928e843d296bf0c912f1e831b2f31ba8339c53
Author: MATILLAT Quentin
Date:   Fri May 31 18:12:35 2019 +0200
Branches: soc-2019-embree-gpu
https://developer.blender.org/rBb9928e843d296bf0c912f1e831b2f31ba8339c53

Fix crash when empty scene

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

M       intern/cycles/bvh/bvh_embree_gpu.cpp

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

diff --git a/intern/cycles/bvh/bvh_embree_gpu.cpp 
b/intern/cycles/bvh/bvh_embree_gpu.cpp
index 52367089ce4..f42040c4f69 100644
--- a/intern/cycles/bvh/bvh_embree_gpu.cpp
+++ b/intern/cycles/bvh/bvh_embree_gpu.cpp
@@ -186,7 +186,9 @@ void BVHEmbreeGPU::build(Progress& progress, Stats *stats_)
         UserParams *userParams = static_cast<UserParams*>(user_ptr);
         void* ptr = rtcThreadLocalAlloc(alloc, sizeof(LeafNode), 16);
 
-        int min = 999999,
+        if(numPrims == 0) return new (ptr) LeafNode(BoundBox::empty, 0, 0, 0);
+
+        int min = std::numeric_limits<int>::max(),
                 max = 0;
         uint visibility = 0;
         BoundBox bounds = BoundBox::empty;

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

Reply via email to