Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-07-11 18:58:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-07-11 18:59:46 +0300
commitea32a0380148b3261679eded2149ebac7e3a15ef (patch)
tree5c1c7c34b9db3f37e58d651688302df78e8f79ee /intern/cycles/kernel/bvh/bvh_shadow_all.h
parent8bc6f8bf20ab13abd232ba12f77eb904dfe95d79 (diff)
Fix T48824: Crash when having too many ray-to-volume intersections
Code might have writing past the array boundaries.
Diffstat (limited to 'intern/cycles/kernel/bvh/bvh_shadow_all.h')
-rw-r--r--intern/cycles/kernel/bvh/bvh_shadow_all.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/kernel/bvh/bvh_shadow_all.h b/intern/cycles/kernel/bvh/bvh_shadow_all.h
index 1d6fa303d3e..1869457f0c3 100644
--- a/intern/cycles/kernel/bvh/bvh_shadow_all.h
+++ b/intern/cycles/kernel/bvh/bvh_shadow_all.h
@@ -254,6 +254,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
/* shadow ray early termination */
if(hit) {
+ /* Update number of hits now, so we do proper check on max bounces. */
+ (*num_hits)++;
+
/* detect if this surface has a shader with transparent shadows */
/* todo: optimize so primitive visibility flag indicates if
@@ -284,14 +287,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
return true;
}
- /* move on to next entry in intersections array */
- isect_array++;
- (*num_hits)++;
#if BVH_FEATURE(BVH_INSTANCING)
num_hits_in_instance++;
#endif
-
- isect_array->t = isect_t;
+ /* Move on to next entry in intersections array */
+ isect_array++;
}
prim_addr++;