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>2018-09-26 14:12:49 +0300
committerAntonioya <blendergit@gmail.com>2018-09-26 14:12:49 +0300
commitd06d1937efe107491aea30e9fcbb6f5fd6a5ca0b (patch)
tree75ed1629c2093c399f26e676d17853b539554f00 /source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
parent2e9b86923c30a5122bf1d6225578bbee35f85c0f (diff)
GP: Check weight data before using it
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c7
1 files changed, 4 insertions, 3 deletions
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 */