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:
authorCampbell Barton <ideasman42@gmail.com>2020-07-30 10:37:35 +0300
committerJeroen Bakker <jeroen@blender.org>2020-08-12 10:03:57 +0300
commit2c68c925243707df50f54fbc49f43916f9bc1e4a (patch)
tree14c4f95403f3f60c35399c625588b4c04fc29d00
parent4a08939e12bef34a7e01713e7db289792ba410c7 (diff)
Fix T79207: Crash converting curve to mesh
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 28a32e1573b..2b9a4b41549 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -285,12 +285,14 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
}
}
else if (dl->type == DL_SURF) {
- int tot;
- totvert += dl->parts * dl->nr;
- tot = (dl->parts - 1 + ((dl->flag & DL_CYCL_V) == 2)) *
- (dl->nr - 1 + (dl->flag & DL_CYCL_U));
- totpoly += tot;
- totloop += tot * 4;
+ if (dl->parts != 0) {
+ int tot;
+ totvert += dl->parts * dl->nr;
+ tot = (((dl->flag & DL_CYCL_U) ? 1 : 0) + (dl->nr - 1)) *
+ (((dl->flag & DL_CYCL_V) ? 1 : 0) + (dl->parts - 1));
+ totpoly += tot;
+ totloop += tot * 4;
+ }
}
else if (dl->type == DL_INDEX3) {
int tot;