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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-08-05 17:48:16 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-16 10:45:29 +0300
commit103e314be4afbbebdadba9e69b19f87d99aa07ab (patch)
tree2b69a0983d87da80f3a1f2dbd2ddd9e2ca9eef6d /source
parentbca66a2a71e8a1fb32f05f544516d3fcb699fe00 (diff)
Cleanup/Fix RNA array length accessors returning non-zero values in invalid cases.
This was apparently done in two places only, with a very cryptic comment (`/* for raw_access, untested */`), and... I cannot see how returning a non-zero length value for an array that does not exist or is not accessible at least, would be anything but an obvious source of issues. Note that both commits adding those lines are from stone ages (2009): rBcbc2c1886dee and rB50e3bb7f5f34.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c2
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index dc0cde953f4..d18bc7f28b3 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -677,7 +677,7 @@ static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr,
length[0] = ikData->numpoints;
}
else {
- length[0] = 256; /* for raw_access, untested */
+ length[0] = 0;
}
return length[0];
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index e74262063c5..c882f7afaf1 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -791,7 +791,7 @@ static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr,
length[0] = gen->arraysize;
}
else {
- length[0] = 100; /* for raw_access, untested */
+ length[0] = 0;
}
return length[0];