From 8ee76535da0b128b35a3ca1ec14b93c909dac359 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 31 Aug 2018 12:14:36 +0200 Subject: [PATCH] Fix T56626: Cycles ambient occlusion only local : crash Was caused by missing NULL pointer check in BVH8. --- intern/cycles/kernel/bvh/obvh_local.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)) {