[#8596] curve editing is unstable
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Mar 2008 20:54:52 +0000 (20:54 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Mar 2008 20:54:52 +0000 (20:54 +0000)
Though I could not reproduce the crash, the example file would always reference an invalid pointer.

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;