Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-01-03 12:39:14 +0300
committerAntonioya <blendergit@gmail.com>2019-01-03 12:39:14 +0300
commitda8febb319ff37f20612add7ebc7cc667b81ab4d (patch)
treea327ab351cef77cea61392acd26b3b2048c03de7
parentbef06a658abc8d467adeb28419c3a44f3186e05e (diff)
Fix T59527: Segment fault changing layer visibility and onion skin
In some situation when the layer is hidden, the onion skin must be disabled too, because the material is not available.
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 1275e93744e..fa16a00183e 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -872,6 +872,9 @@ static void gpencil_draw_onion_strokes(
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ if (gp_style == NULL) {
+ continue;
+ }
copy_v4_v4(gps->runtime.tmp_stroke_rgba, gp_style->stroke_rgba);
copy_v4_v4(gps->runtime.tmp_fill_rgba, gp_style->fill_rgba);