[Bf-blender-cvs] [df7be61] master: Fix T49023: Segfault when switching brushes while renaming another brush.

Bastien Montagne noreply at git.blender.org
Fri Aug 5 23:37:00 CEST 2016


Commit: df7be614382ba6ce58a2fab4ff6b4ab0b09b0a9f
Author: Bastien Montagne
Date:   Fri Aug 5 23:33:22 2016 +0200
Branches: master
https://developer.blender.org/rBdf7be614382ba6ce58a2fab4ff6b4ab0b09b0a9f

Fix T49023: Segfault when switching brushes while renaming another brush.

rna_GPencilBrush_name_set() was trying to use a mere bGPDbrush as a complete ToolSettings,
was doomed to fail...

===================================================================

M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 8a4f41d..b6abe98 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -542,7 +542,7 @@ static void rna_GPencilBrush_index_range(PointerRNA *ptr, int *min, int *max, in
 
 static void rna_GPencilBrush_name_set(PointerRNA *ptr, const char *value)
 {
-	ToolSettings *ts = (ToolSettings *) ptr->data;
+	ToolSettings *ts = ((Scene *) ptr->id.data)->toolsettings;
 	bGPDbrush *brush = ptr->data;
 
 	/* copy the new name into the name slot */




More information about the Bf-blender-cvs mailing list