Fix T57811: Render crashes in certain scenes when AO Bounces are used
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 21 Nov 2018 13:17:26 +0000 (14:17 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 21 Nov 2018 13:17:26 +0000 (14:17 +0100)
intern/cycles/kernel/geom/geom_triangle_intersect.h

index fa686d8a2239796955e89a6b20da19c9ab1c3397..57f4c86d40341f4a5343f1b52ff371fe7bd88410 100644 (file)
@@ -309,7 +309,7 @@ ccl_device_inline int ray_triangle_intersect8(
                                        return 2;
                                }
                                /* If maximum number of hits reached, block all light. */
-                               else if(*num_hits == max_hits) {
+                               else if(num_hits == NULL || *num_hits == max_hits) {
                                        return 2;
                                }
                                /* Move on to next entry in intersections array. */