[#8596] curve editing is unstable
[blender.git] / source / blender / blenkernel / intern / curve.c
index dcd8bc6d9ebcfb51494b60bfce40f52fa1affa14..e1b2b30a7710645811e21bfc6db9b1cc73fcd669 100644 (file)
@@ -1976,6 +1976,9 @@ float calc_curve_subdiv_radius(Curve *cu, Nurb *nu, int cursubdiv)
                if ( ((nu->type & 7)==CU_NURBS) && (nu->flagu & CU_CYCLIC)) {
                        if (bp >= bplast) bp = bpfirst;
                        else bp++;
+               } else if ( bp >= bplast ) {
+                       /* this can happen in rare cases, refer to bug [#8596] */
+                       bp = bplast;
                }
                
                rad = prevrad = bp->radius;