diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-26 14:33:52 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-26 14:34:02 +0300 |
commit | 90e8f94558ed8f233f536c37c3bc98e0f969b517 (patch) | |
tree | bb97875bd8370a556c194a59e5c5bf4d5944bd17 /source/blender/gpencil_modifiers/intern | |
parent | 671b6d41c408d8cf16bf9a1d0cb38dfa185c61b9 (diff) |
Fix T75094: Gpencil Selection mode crash in Vertex Paint when build modifier is used
Diffstat (limited to 'source/blender/gpencil_modifiers/intern')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c index 3263b78ba85..435559f4881 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c @@ -116,7 +116,7 @@ static void reduce_stroke_points(bGPDstroke *gps, { bGPDspoint *new_points = MEM_callocN(sizeof(bGPDspoint) * num_points, __func__); MDeformVert *new_dvert = NULL; - if (gps->dvert != NULL) { + if ((gps->dvert != NULL) && (num_points > 0)) { new_dvert = MEM_callocN(sizeof(MDeformVert) * num_points, __func__); } @@ -130,7 +130,7 @@ static void reduce_stroke_points(bGPDstroke *gps, { /* copy over point data */ memcpy(new_points, gps->points, sizeof(bGPDspoint) * num_points); - if (gps->dvert != NULL) { + if ((gps->dvert != NULL) && (num_points > 0)) { memcpy(new_dvert, gps->dvert, sizeof(MDeformVert) * num_points); /* free unused point weights */ @@ -151,7 +151,7 @@ static void reduce_stroke_points(bGPDstroke *gps, /* copy over point data */ memcpy(new_points, gps->points + offset, sizeof(bGPDspoint) * num_points); - if (gps->dvert != NULL) { + if ((gps->dvert != NULL) && (num_points > 0)) { memcpy(new_dvert, gps->dvert + offset, sizeof(MDeformVert) * num_points); /* free unused weights */ |