From 315246b7ce120b8f42ecae74dfe378fe58a57262 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 29 Sep 2021 19:52:54 +0200 Subject: Fix Cycles use of uninitialized value in shadow stack intersection on CPU The patch is against the studio branch. In the master branch it got fixed with the Cycles X merge. Differential Revision: https://developer.blender.org/D12705 --- intern/cycles/bvh/bvh_embree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp index f14d30065e3..0089394103c 100644 --- a/intern/cycles/bvh/bvh_embree.cpp +++ b/intern/cycles/bvh/bvh_embree.cpp @@ -81,7 +81,7 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args) if (ctx->num_hits < ctx->max_hits) { Intersection current_isect; kernel_embree_convert_hit(kg, ray, hit, ¤t_isect); - for (size_t i = 0; i < ctx->max_hits; ++i) { + for (size_t i = 0; i < ctx->num_hits; ++i) { if (current_isect.object == ctx->isect_s[i].object && current_isect.prim == ctx->isect_s[i].prim && current_isect.t == ctx->isect_s[i].t) { /* This intersection was already recorded, skip it. */ -- cgit v1.2.3