[Bf-blender-cvs] [8ee76535da0] master: Fix T56626: Cycles ambient occlusion only local : crash

Sergey Sharybin noreply at git.blender.org
Fri Aug 31 12:26:23 CEST 2018


Commit: 8ee76535da0b128b35a3ca1ec14b93c909dac359
Author: Sergey Sharybin
Date:   Fri Aug 31 12:14:36 2018 +0200
Branches: master
https://developer.blender.org/rB8ee76535da0b128b35a3ca1ec14b93c909dac359

Fix T56626: Cycles ambient occlusion only local : crash

Was caused by missing NULL pointer check in BVH8.

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

M	intern/cycles/kernel/bvh/obvh_local.h

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

diff --git a/intern/cycles/kernel/bvh/obvh_local.h b/intern/cycles/kernel/bvh/obvh_local.h
index 50bcfa79b6c..92143193a6a 100644
--- a/intern/cycles/kernel/bvh/obvh_local.h
+++ b/intern/cycles/kernel/bvh/obvh_local.h
@@ -50,7 +50,10 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
 	int object = OBJECT_NONE;
 	float isect_t = ray->t;
 
-	local_isect->num_hits = 0;
+	if(local_isect != NULL) {
+		local_isect->num_hits = 0;
+	}
+	kernel_assert((local_isect == NULL) == (max_hits == 0));
 
 	const int object_flag = kernel_tex_fetch(__object_flag, local_object);
 	if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {



More information about the Bf-blender-cvs mailing list