Fix T68831: use NULL instead of the wrong pointer to read default array.

The pointer argument is supposed to be the object the property belongs
to, not a pointer to the property metadata itself. This only worked
before because the argument was never used.
This commit is contained in:
Alexander Gavrilov 2019-08-19 19:38:28 +03:00
parent 953264138d
commit e54cde403c
Notes: blender-bot 2023-02-14 05:59:31 +01:00
Referenced by issue #68831, RNA introspection broken (hard crash) by rBaef08fda3ade
1 changed files with 6 additions and 3 deletions

View File

@ -770,7 +770,8 @@ static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values)
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
if (prop->totarraylength > 0) {
RNA_property_int_get_default_array(ptr, prop, values);
PointerRNA null_ptr = PointerRNA_NULL;
RNA_property_int_get_default_array(&null_ptr, prop, values);
}
}
@ -779,7 +780,8 @@ static void rna_BoolProperty_default_array_get(PointerRNA *ptr, bool *values)
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
if (prop->totarraylength > 0) {
RNA_property_boolean_get_default_array(ptr, prop, values);
PointerRNA null_ptr = PointerRNA_NULL;
RNA_property_boolean_get_default_array(&null_ptr, prop, values);
}
}
@ -788,7 +790,8 @@ static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values)
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
if (prop->totarraylength > 0) {
RNA_property_float_get_default_array(ptr, prop, values);
PointerRNA null_ptr = PointerRNA_NULL;
RNA_property_float_get_default_array(&null_ptr, prop, values);
}
}