Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-12-12 14:00:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-12 14:01:20 +0400
commitafffa9bc39d54eec505c9397d56a2c8275d81e08 (patch)
tree578faf9ccb09b601631cc72f4ee949b1e3c83096
parenta0a09d14233b7928418205cdcd82227823a1315e (diff)
RNA: Add assert to ensure the idprop is correct size on array get/set
-rw-r--r--source/blender/makesrna/intern/rna_access.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 1811f2e1a5f..2d89424d177 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1983,6 +1983,7 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
BLI_assert(RNA_property_array_check(prop) != false);
if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ BLI_assert(idprop->len == RNA_property_array_length(ptr, prop));
if (prop->arraydimension == 0)
values[0] = RNA_property_int_get(ptr, prop);
else
@@ -2071,6 +2072,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v
BLI_assert(RNA_property_array_check(prop) != false);
if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ BLI_assert(idprop->len == RNA_property_array_length(ptr, prop));
if (prop->arraydimension == 0)
IDP_Int(idprop) = values[0];
else
@@ -2243,6 +2245,7 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val
BLI_assert(RNA_property_array_check(prop) != false);
if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ BLI_assert(idprop->len == RNA_property_array_length(ptr, prop));
if (prop->arraydimension == 0)
values[0] = RNA_property_float_get(ptr, prop);
else if (idprop->subtype == IDP_FLOAT) {
@@ -2337,6 +2340,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa
BLI_assert(RNA_property_array_check(prop) != false);
if ((idprop = rna_idproperty_check(&prop, ptr))) {
+ BLI_assert(idprop->len == RNA_property_array_length(ptr, prop));
if (prop->arraydimension == 0) {
if (idprop->type == IDP_FLOAT)
IDP_Float(idprop) = values[0];