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
path: root/source
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-04-08 13:18:15 +0300
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:32:00 +0300
commit133fa9cb7fa371c322d3c907b78254a48d26f940 (patch)
tree84061ce22692ffad551cfaa9b62ed3bf05cafe30 /source
parent1f0302cb6abef4b429a5057ac7c3d43cc43ef890 (diff)
Fix T97150: Export GPencil to PDF or SVG crashes blender
The problem was the original file had some vertex weight information, but the weights array was empty, so the duplication was not done and the free memory crashed. To avoid this type of errors, now before duplicate weights the function checks the pointer and also the number of weights elements in the array to avoid the duplicatiopn of empty data.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 92ed273cac8..087d8b8fcd4 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -867,7 +867,7 @@ bGPDstroke *BKE_gpencil_stroke_duplicate(bGPDstroke *gps_src,
if (dup_points) {
gps_dst->points = MEM_dupallocN(gps_src->points);
- if (gps_src->dvert != NULL) {
+ if ((gps_src->dvert != NULL) && (gps_src->dvert->totweight > 0)) {
gps_dst->dvert = MEM_dupallocN(gps_src->dvert);
BKE_gpencil_stroke_weights_duplicate(gps_src, gps_dst);
}