Cycles: Fixed crash when the camera was inside 16 volumes or more. It still won't render those volumes correctly, but at least the crash is addressed.

This commit is contained in:
Stefan Werner
2018-06-19 16:34:15 +02:00
parent b5893b1ba3
commit 9ff135d85d

View 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;