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.
This commit is contained in:
parent
27b9cb7a1e
commit
834523e239
Notes:
blender-bot
2023-02-14 10:32:59 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93 Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -715,7 +715,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];
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue