Fix T79207: Crash converting curve to mesh

This commit is contained in:
Campbell Barton 2020-07-30 17:37:35 +10:00 committed by Jeroen Bakker
parent 4a08939e12
commit 2c68c92524
Notes: blender-bot 2023-02-14 07:47:59 +01:00
Referenced by issue #79207, Trimmed curve with subsurf crashes Blender
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 8 additions and 6 deletions

View File

@ -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;