Fix T92645: Cycles OSL crash due use of uninitialized pointer

Thanks to Ilja Razinkov for identifying the problem and solution.
This commit is contained in:
Brecht Van Lommel 2021-11-09 14:56:22 +01:00
parent 9b2f212016
commit 5f44298280
Notes: blender-bot 2023-02-13 17:16:24 +01:00
Referenced by issue #92645, OSL: Blender crashes when activating object with OSL material (still)
1 changed files with 2 additions and 0 deletions

View File

@ -132,10 +132,12 @@ static void shaderdata_to_shaderglobals(const KernelGlobalsCPU *kg,
/* Used by render-services. */
sd->osl_globals = kg;
if (path_flag & PATH_RAY_SHADOW) {
sd->osl_path_state = nullptr;
sd->osl_shadow_path_state = (const IntegratorShadowStateCPU *)state;
}
else {
sd->osl_path_state = (const IntegratorStateCPU *)state;
sd->osl_shadow_path_state = nullptr;
}
}