Fix T39740: New Autosmooth instant crash entering Edit Mode

One should always be wary of last minute changes, especially in comples code area... :/
This commit is contained in:
Bastien Montagne 2014-04-14 23:42:38 +02:00
parent 0c51010c67
commit 3cf39fc72a
Notes: blender-bot 2023-02-14 10:48:27 +01:00
Referenced by issue #39749, Holdout shader and Transparent shader don't use the background's alpha channel when used with Light Path node.
Referenced by issue #39740, New Autosmooth instant crash entering Edit Mode
Referenced by issue #39743, Crash when deleting faces in with new autosmooth
Referenced by issue #39747, Unable to update mesh vertex properties via Python when mesh is influenced by armature
1 changed files with 7 additions and 1 deletions

View File

@ -570,7 +570,13 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, const float (*vcos)[3], const
while (true) {
/* Much simpler than in sibling code with basic Mesh data! */
lfan_pivot_next = BM_vert_step_fan_loop(lfan_pivot, &e_next);
BLI_assert(lfan_pivot_next->v == v_pivot);
if (lfan_pivot_next) {
BLI_assert(lfan_pivot_next->v == v_pivot);
}
else {
/* next edge is non-manifold, we have to find it ourselves! */
e_next = (lfan_pivot->e == e_next) ? lfan_pivot->prev->e : lfan_pivot->e;
}
/* Compute edge vector.
* NOTE: We could pre-compute those into an array, in the first iteration, instead of computing them