From 389d5504120fb1a331a13118979a896b7e31ee0f Mon Sep 17 00:00:00 2001 From: "Garry R. Osgood" Date: Tue, 2 Jun 2020 05:55:59 +0200 Subject: [PATCH 1/2] Fix T77106: Cycles crash baking with AO shader node Differential Revision: https://developer.blender.org/D7890 --- intern/cycles/kernel/bvh/bvh.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h index b3992c03a9a..9b9df883b62 100644 --- a/intern/cycles/kernel/bvh/bvh.h +++ b/intern/cycles/kernel/bvh/bvh.h @@ -300,7 +300,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg, // Is set to zero on miss or if ray is aborted, so can be used as return value uint p5 = max_hits; - local_isect->num_hits = 0; // Initialize hit count to zero + if (local_isect) { + local_isect->num_hits = 0; // Initialize hit count to zero + } optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, ray->P, ray->D, @@ -323,7 +325,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg, return p5; # else /* __KERNEL_OPTIX__ */ if (!scene_intersect_valid(ray)) { - local_isect->num_hits = 0; + if (local_isect) { + local_isect->num_hits = 0; + } return false; } From 7881c251f330e60cb9931143c46e302789f8007b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 2 Jun 2020 06:26:28 +0200 Subject: [PATCH 2/2] Fix build error in Cycles standalone without guarded allocator Solution suggested by howetuft. Differential Revision: https://developer.blender.org/D7892 --- intern/cycles/util/util_guarded_allocator.h | 1 + 1 file changed, 1 insertion(+) diff --git a/intern/cycles/util/util_guarded_allocator.h b/intern/cycles/util/util_guarded_allocator.h index 2d09326d2ca..f78cc5f5da9 100644 --- a/intern/cycles/util/util_guarded_allocator.h +++ b/intern/cycles/util/util_guarded_allocator.h @@ -18,6 +18,7 @@ #define __UTIL_GUARDED_ALLOCATOR_H__ #include +#include #include #ifdef WITH_BLENDER_GUARDEDALLOC