[Bf-blender-cvs] [e990e55eba2] master: Fix crash with missing NULL check accessing grease pencil paint

Campbell Barton noreply at git.blender.org
Thu Mar 26 05:41:36 CET 2020


Commit: e990e55eba2aa8734cb328065b1731dc83e39187
Author: Campbell Barton
Date:   Thu Mar 26 15:10:58 2020 +1100
Branches: master
https://developer.blender.org/rBe990e55eba2aa8734cb328065b1731dc83e39187

Fix crash with missing NULL check accessing grease pencil paint

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

M	source/blender/editors/sculpt_paint/paint_ops.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index ff0852aaf16..cc848b80bb3 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -779,6 +779,9 @@ static int brush_select_exec(bContext *C, wmOperator *op)
   }
 
   Paint *paint = BKE_paint_get_active_from_paintmode(scene, paint_mode);
+  if (paint == NULL) {
+    return OPERATOR_CANCELLED;
+  }
   const EnumPropertyItem *items = BKE_paint_get_tool_enum_from_paintmode(paint_mode);
   RNA_enum_name_from_value(items, tool, &tool_name);



More information about the Bf-blender-cvs mailing list