From d06d1937efe107491aea30e9fcbb6f5fd6a5ca0b Mon Sep 17 00:00:00 2001 From: Antonioya Date: Wed, 26 Sep 2018 13:12:49 +0200 Subject: GP: Check weight data before using it --- source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/gpencil_modifiers') diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c index 613c46803b9..3f4183e5b7a 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c @@ -168,9 +168,10 @@ static void generate_geometry( /* Duplicate stroke */ bGPDstroke *gps_dst = MEM_dupallocN(gps); gps_dst->points = MEM_dupallocN(gps->points); - gps_dst->dvert = MEM_dupallocN(gps->dvert); - BKE_gpencil_stroke_weights_duplicate(gps, gps_dst); - + if (gps->dvert) { + gps_dst->dvert = MEM_dupallocN(gps->dvert); + BKE_gpencil_stroke_weights_duplicate(gps, gps_dst); + } gps_dst->triangles = MEM_dupallocN(gps->triangles); /* Move points */ -- cgit v1.2.3