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:
authorAlexander Gavrilov <angavrilov@gmail.com>2021-01-13 12:33:39 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2021-01-13 14:09:31 +0300
commit8185d07ace493a74fb1b99636f4bb80174b81418 (patch)
treef06140c5e03ba62e444243b160536bdfae9d5318 /source/blender/makesrna/intern/rna_access.c
parent38df935c0985ea10dd79b92f6cb5f468931f04c1 (diff)
RNA: fix a crash when setting bare IDProperty pointers.
The rna_idproperty_check call should be done before accessing the prop pointer so that it can detect IDProperty values and replace them with the actual PointerPropertyRNA object. Ref D10098
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 0479c5d1eed..70757573051 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -3678,8 +3678,10 @@ void RNA_property_pointer_set(PointerRNA *ptr,
PointerRNA ptr_value,
ReportList *reports)
{
- PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
+ /* Detect IDProperty and retrieve the actual PropertyRNA pointer before cast. */
IDProperty *idprop = rna_idproperty_check(&prop, ptr);
+
+ PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
BLI_assert(RNA_property_type(prop) == PROP_POINTER);
/* Check types. */