[Bf-blender-cvs] [367775ac6a2] master: Fix Cycles use of uninitialized value in volume stack intersection on CPU

Brecht Van Lommel noreply at git.blender.org
Wed Sep 29 16:37:37 CEST 2021


Commit: 367775ac6a2d1a4d002952aa2731778f99d13d6a
Author: Brecht Van Lommel
Date:   Wed Sep 29 16:14:38 2021 +0200
Branches: master
https://developer.blender.org/rB367775ac6a2d1a4d002952aa2731778f99d13d6a

Fix Cycles use of uninitialized value in volume stack intersection on CPU

Could cause an actual bug but probability is low in practice.

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

M	intern/cycles/bvh/bvh_embree.cpp

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

diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp
index 96852510b63..20430cb164c 100644
--- a/intern/cycles/bvh/bvh_embree.cpp
+++ b/intern/cycles/bvh/bvh_embree.cpp
@@ -213,7 +213,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