Blender Git Loki
Git Commits -> Revision 5580b56
Revision 5580b56 by Joshua Leung (master) April 22, 2013, 13:22 (GMT) |
Bugfix [#34836] Crash when driver variable has path == 'data' Most of the places which relied on RNA_path_resolve() did so believing that if it returned true, that it had found a valid property, and that the returned pointer+property combination would be what the path referred to. However, it turns out that if the property at the end of the path turns out to be a "pointer" property (e.g. "data" for Object.data), this would automatically become the pointer part, while the prop part would be set to null. Hence, if a user accidentally (or otherwise) specifies a path for the single-property driver variable type like this, then Blender would crash. This commit introduces two convenience functions - RNA_path_resolve_property() and RNA_path_resolve_property_full() - which mirror/wrap the existing RNA_path_resolve() functions. The only difference though is that these include a check to ensure that what was found from resolving the path was in fact a property (they only return true iff this is the case), and make it explicitly clear in the name that this is what they will do so that there's no further confusion. It is possible to do without these wrapper functions by doing these checks inline, but the few cases that had been patched already were pretty hideous looking specimens. Using these just make it clearer and simpler for all. I've also beefed up the docs on these a bit, and changed these to using bools. |
Commit Details:
Full Hash: 5580b568765a89bbe02f21cee839c585260ef6c2
SVN Revision: 56206
Parent Commit: 319036f
Lines Changed: +66, -31
15 Modified Paths:
/source/blender/blenkernel/intern/anim_sys.c (+4, -4) (Diff)
/source/blender/blenkernel/intern/fcurve.c (+1, -1) (Diff)
/source/blender/editors/animation/anim_channels_defines.c (+3, -3) (Diff)
/source/blender/editors/animation/anim_deps.c (+1, -1) (Diff)
/source/blender/editors/animation/anim_draw.c (+1, -1) (Diff)
/source/blender/editors/animation/anim_ipo_utils.c (+1, -1) (Diff)
/source/blender/editors/animation/drivers.c (+3, -3) (Diff)
/source/blender/editors/animation/keyframing.c (+4, -4) (Diff)
/source/blender/editors/animation/keyingsets.c (+1, -1) (Diff)
/source/blender/editors/armature/pose_slide.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_ops.c (+2, -2) (Diff)
/source/blender/editors/space_graph/graph_buttons.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_access.c (+32, -5) (Diff)
/source/blender/makesrna/RNA_access.h (+10, -2) (Diff)
/source/blender/python/intern/bpy_rna_anim.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/fcurve.c (+1, -1) (Diff)
/source/blender/editors/animation/anim_channels_defines.c (+3, -3) (Diff)
/source/blender/editors/animation/anim_deps.c (+1, -1) (Diff)
/source/blender/editors/animation/anim_draw.c (+1, -1) (Diff)
/source/blender/editors/animation/anim_ipo_utils.c (+1, -1) (Diff)
/source/blender/editors/animation/drivers.c (+3, -3) (Diff)
/source/blender/editors/animation/keyframing.c (+4, -4) (Diff)
/source/blender/editors/animation/keyingsets.c (+1, -1) (Diff)
/source/blender/editors/armature/pose_slide.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_ops.c (+2, -2) (Diff)
/source/blender/editors/space_graph/graph_buttons.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_access.c (+32, -5) (Diff)
/source/blender/makesrna/RNA_access.h (+10, -2) (Diff)
/source/blender/python/intern/bpy_rna_anim.c (+1, -1) (Diff)