From 93aae90ab57323761ef918ada52f3a126b762fb4 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 5 Aug 2021 16:48:16 +0200 Subject: 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. --- source/blender/makesrna/intern/rna_constraint.c | 2 +- source/blender/makesrna/intern/rna_fcurve.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a3934b12a44..260d3ea0cc6 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -705,7 +705,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 d4697721bc2..4bc0f5f8708 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -809,7 +809,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]; -- cgit v1.2.3