Fix T56626: Cycles ambient occlusion only local : crash

Was caused by missing NULL pointer check in BVH8.
This commit is contained in:
Sergey Sharybin 2018-08-31 12:14:36 +02:00
parent 976f14fbcf
commit 8ee76535da
Notes: blender-bot 2023-02-14 08:28:46 +01:00
Referenced by issue #56626, cycles ambient occlusion only local : crash
1 changed files with 4 additions and 1 deletions

View File

@ -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)) {