Fix T40482: Cycles matlib file crashes
it's possible that runtime optimizer would call get_attribute with NULL renderstate. As per documentation, it's valid to return false in that cases and in worst case we'll just miss some possible optimization. Supporting such cases would require some bigger changes to Cycles since attributes are only set to up for the kernel after shader compilation. Thanks Brecht for review!
This commit is contained in:
@@ -754,6 +754,9 @@ bool OSLRenderServices::get_background_attribute(KernelGlobals *kg, ShaderData *
|
||||
bool OSLRenderServices::get_attribute(void *renderstate, bool derivatives, ustring object_name,
|
||||
TypeDesc type, ustring name, void *val)
|
||||
{
|
||||
if (renderstate == NULL)
|
||||
return false;
|
||||
|
||||
ShaderData *sd = (ShaderData *)renderstate;
|
||||
KernelGlobals *kg = sd->osl_globals;
|
||||
bool is_curve;
|
||||
|
||||
Reference in New Issue
Block a user