Fix #19742: shape key crashes for curve & lattice.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 4 Nov 2009 09:20:31 +0000 (09:20 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 4 Nov 2009 09:20:31 +0000 (09:20 +0000)
source/blender/blenkernel/intern/curve.c
source/blender/editors/object/object_shapekey.c

index f31f4cd975385dbef6fb2ef5242fa7d60c48896a..5580070b922759e81301f4d30601637eedd2f301 100644 (file)
@@ -2906,7 +2906,7 @@ void curve_applyVertexCos(Curve *cu, ListBase *lb, float (*vertexCos)[3])
 
 float (*curve_getKeyVertexCos(Curve *cu, ListBase *lb, float *key))[3]
 {
-       int i, numVerts;
+       int i, numVerts = count_curveverts(lb);
        float *co, (*cos)[3] = MEM_mallocN(sizeof(*cos)*numVerts, "cu_vcos");
        Nurb *nu;
 
index c9fb3351af93729ae04b7d8abcce67baa304cb13..f52927a1a001a328b771de5be4f0801090065fc6 100644 (file)
@@ -238,6 +238,7 @@ static void insert_lattkey(Scene *scene, Object *ob)
        if(key==NULL) {
                key= lt->key= add_key( (ID *)lt);
                key->type= KEY_RELATIVE;
+               newkey= 1;
        }
 
        kb= add_keyblock(scene, key);