[Bf-blender-cvs] [e54cde403c4] master: Fix T68831: use NULL instead of the wrong pointer to read default array.

Alexander Gavrilov noreply at git.blender.org
Mon Aug 19 19:23:20 CEST 2019


Commit: e54cde403c47ef2af1f5166f2e8895d051fe7e36
Author: Alexander Gavrilov
Date:   Mon Aug 19 19:38:28 2019 +0300
Branches: master
https://developer.blender.org/rBe54cde403c47ef2af1f5166f2e8895d051fe7e36

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.

===================================================================

M	source/blender/makesrna/intern/rna_rna.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index cb075884915..dc7e861421e 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -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);
   }
 }



More information about the Bf-blender-cvs mailing list