Fix: is_overridable crash with certain ShapeKey functions parameters #118453

Open
Philipp Oeser wants to merge 1 commits from lichtwerk/blender:106406 into blender-v4.1-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

1 Commits

Author SHA1 Message Date
Philipp Oeser da215bf839 Fix: `is_overridable` crash with certain ShapeKey functions parameters
Probably caused by 337e2c9029

`rna_Property_overridable_get` does `rna_idproperty_check` [which also
tries to set `PropertyRNAOrID` `array_len`].

In case of ShapeKey normals functions (normals_XXX_get()) "normals"
parameters, this then tries to get the length via e.g
`rna_KeyBlock_normals_vert_len`, but without an ID or owner_id. This is
OK (since we are querying just for the general function, so not with a
specific ID), but crashes since `rna_ShapeKey_find_key` further down the
line accesses the (NULL) ID.

So solution here is to guard in `rna_ShapeKey_find_key` against a non-ID
(and rightfully return NULL here).

NOTE there might be other cases where `rna_Property_overridable_get`
might fail after the behavior change of 337e2c9029 due to the above
(but havent spotted any nor found other reports about this).

Fixes #106406
2024-02-19 11:17:04 +01:00