Cycles: Fixed crash when the camera was inside 16 volumes or more. It still won't...
authorStefan Werner <stefan.werner@tangent-animation.com>
Tue, 19 Jun 2018 14:34:15 +0000 (16:34 +0200)
committerStefan Werner <stefan.werner@tangent-animation.com>
Tue, 19 Jun 2018 14:35:18 +0000 (16:35 +0200)
intern/cycles/kernel/kernel_volume.h

index 86378289b02a70fcc9dcc4b212908acdb1d3e477..58032545338a521ad23a3b67321d7227eafe5dab 100644 (file)
@@ -1172,7 +1172,7 @@ ccl_device void kernel_volume_stack_init(KernelGlobals *kg,
                                                break;
                                        }
                                }
-                               if(need_add) {
+                               if(need_add && stack_index < VOLUME_STACK_SIZE - 1) {
                                        stack[stack_index].object = stack_sd->object;
                                        stack[stack_index].shader = stack_sd->shader;
                                        ++stack_index;