[Bf-blender-cvs] [315246b7ce1] temp-studio-sprite-fright-cycles: Fix Cycles use of uninitialized value in shadow stack intersection on CPU

Sergey Sharybin noreply at git.blender.org
Wed Sep 29 20:18:04 CEST 2021


Commit: 315246b7ce120b8f42ecae74dfe378fe58a57262
Author: Sergey Sharybin
Date:   Wed Sep 29 19:52:54 2021 +0200
Branches: temp-studio-sprite-fright-cycles
https://developer.blender.org/rB315246b7ce120b8f42ecae74dfe378fe58a57262

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

===================================================================

M	intern/cycles/bvh/bvh_embree.cpp

===================================================================

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, &current_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. */



More information about the Bf-blender-cvs mailing list