Fix T84063: crash reading pointer properties in Attribute shader node

Path resolving can find e.g. a datablock rather than a float or integer,
treat that as a failure to find a valid property.
This commit is contained in:
Brecht Van Lommel 2020-12-23 15:45:55 +01:00
parent 635694c0ff
commit 9d04fa39d1
Notes: blender-bot 2023-02-14 00:44:02 +01:00
Referenced by issue #84063, Material nodes, Attribute node: crash if attempting to use an ID property
2 changed files with 8 additions and 0 deletions

View File

@ -351,6 +351,10 @@ static bool lookup_property(BL::ID b_id, const string &name, float4 *r_value)
return false;
}
if (prop == NULL) {
return false;
}
PropertyType type = RNA_property_type(prop);
int arraylen = RNA_property_array_length(&ptr, prop);

View File

@ -633,6 +633,10 @@ static bool drw_uniform_property_lookup(ID *id, const char *name, float r_data[4
return false;
}
if (prop == NULL) {
return false;
}
PropertyType type = RNA_property_type(prop);
int arraylen = RNA_property_array_length(&ptr, prop);