diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-19 13:48:38 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-19 13:50:01 +0300 |
commit | e49ee5a8084c619905947486c071ddd44c9e42d1 (patch) | |
tree | 9dc486e969006b4697707655b487511e8e35c737 /source/blender/editors/sculpt_paint | |
parent | 93887d10961a65843f8e70d7d4f5a1b64aba46b5 (diff) |
Fix (unreported) crash when unlinking a brush from a tool.
Cursor drawing code was not checking for potential NULL pointers.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 2e24c2533c5..f0285c8faf3 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -1265,7 +1265,13 @@ static bool paint_cursor_context_init(bContext *C, pcontext->scene = CTX_data_scene(C); pcontext->ups = &pcontext->scene->toolsettings->unified_paint_settings; pcontext->paint = BKE_paint_get_active_from_context(C); + if (pcontext->paint == NULL) { + return false; + } pcontext->brush = BKE_paint_brush(pcontext->paint); + if (pcontext->brush == NULL) { + return false; + } pcontext->mode = BKE_paintmode_get_active_from_context(C); ED_view3d_viewcontext_init(C, &pcontext->vc, pcontext->depsgraph); |