[Bf-blender-cvs] [e47ea9fbc7c] master: GPencil: Fix unreported crash when style is NULL

Antonio Vazquez noreply at git.blender.org
Wed Nov 11 12:16:48 CET 2020


Commit: e47ea9fbc7c0c27843f2e934bafb3d36416c88ee
Author: Antonio Vazquez
Date:   Wed Nov 11 11:31:33 2020 +0100
Branches: master
https://developer.blender.org/rBe47ea9fbc7c0c27843f2e934bafb3d36416c88ee

GPencil: Fix unreported crash when style is NULL

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

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

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index 948255b3852..cdcfd569fff 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -62,7 +62,7 @@ GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob)
   tgp_ob->do_mat_holdout = false;
   for (int i = 0; i < ob->totcol; i++) {
     MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, i + 1);
-    if ((gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT) ||
+    if ((gp_style != NULL) && (gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT) ||
         ((gp_style->flag & GP_MATERIAL_IS_FILL_HOLDOUT))) {
       tgp_ob->do_mat_holdout = true;
       break;



More information about the Bf-blender-cvs mailing list