[Bf-blender-cvs] [92c3b81490a] greasepencil-object: Fix segment fault when delete object

Antonio Vazquez noreply at git.blender.org
Sun Dec 17 19:57:57 CET 2017


Commit: 92c3b81490a21d2cf9a87ac352812186503aefaa
Author: Antonio Vazquez
Date:   Sun Dec 17 19:57:33 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB92c3b81490a21d2cf9a87ac352812186503aefaa

Fix segment fault when delete object

The active object got null and this produced a segment fault.

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

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index b43dc11458c..48d7f951331 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -584,7 +584,7 @@ static void gpencil_add_editpoints_shgroup(
 	if (GPENCIL_ANY_EDIT_MODE(gpd)) {
 		const DRWContextState *draw_ctx = DRW_context_state_get();
 		Object *obact = draw_ctx->obact;
-		if (obact->type != OB_GPENCIL) {
+		if ((!obact) || (obact->type != OB_GPENCIL)) {
 			return;
 		}
 		bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);



More information about the Bf-blender-cvs mailing list