[Bf-blender-cvs] [75e392ae9f8] blender-v2.79-release: Cycles: Fix stack overflow during traversal caused by floating overflow

Sergey Sharybin noreply at git.blender.org
Mon Sep 4 13:12:14 CEST 2017


Commit: 75e392ae9f8fac8c4cadddebc14494ce6fcdb5c4
Author: Sergey Sharybin
Date:   Fri Aug 25 14:00:33 2017 +0200
Branches: blender-v2.79-release
https://developer.blender.org/rB75e392ae9f8fac8c4cadddebc14494ce6fcdb5c4

Cycles: Fix stack overflow during traversal caused by floating overflow

Would be nice to be able to catch this with assert as well, will see what would
be the best way to do this/.\

Need to verify with Mai that this solves crash for her and maybe consider
porting this to 2.79.

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

M	intern/cycles/bvh/bvh4.cpp

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

diff --git a/intern/cycles/bvh/bvh4.cpp b/intern/cycles/bvh/bvh4.cpp
index 5034ab811d5..3ecea600e1a 100644
--- a/intern/cycles/bvh/bvh4.cpp
+++ b/intern/cycles/bvh/bvh4.cpp
@@ -242,21 +242,21 @@ void BVH4::pack_unaligned_node(int idx,
 		 * so kernel might safely assume there are always 4 child nodes.
 		 */
 
-		data[1][i] = 1.0f;
-		data[2][i] = 0.0f;
-		data[3][i] = 0.0f;
+		data[1][i] = NAN;
+		data[2][i] = NAN;
+		data[3][i] = NAN;
 
-		data[4][i] = 0.0f;
-		data[5][i] = 0.0f;
-		data[6][i] = 0.0f;
+		data[4][i] = NAN;
+		data[5][i] = NAN;
+		data[6][i] = NAN;
 
-		data[7][i] = 0.0f;
-		data[8][i] = 0.0f;
-		data[9][i] = 0.0f;
+		data[7][i] = NAN;
+		data[8][i] = NAN;
+		data[9][i] = NAN;
 
-		data[10][i] = -FLT_MAX;
-		data[11][i] = -FLT_MAX;
-		data[12][i] = -FLT_MAX;
+		data[10][i] = NAN;
+		data[11][i] = NAN;
+		data[12][i] = NAN;
 
 		data[13][i] = __int_as_float(0);
 	}



More information about the Bf-blender-cvs mailing list