[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13980] trunk/blender/source/blender/src/ editipo.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Mar 5 18:12:10 CET 2008


Revision: 13980
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13980
Author:   blendix
Date:     2008-03-05 18:12:09 +0100 (Wed, 05 Mar 2008)

Log Message:
-----------

Bugfix: crash inserting keyframes with missing pose channel. Also
changed some memcpy calls to memmove since memcpy doesn't allow
the buffers to overlap, but it's probably harmless.

Modified Paths:
--------------
    trunk/blender/source/blender/src/editipo.c

Modified: trunk/blender/source/blender/src/editipo.c
===================================================================
--- trunk/blender/source/blender/src/editipo.c	2008-03-05 15:13:41 UTC (rev 13979)
+++ trunk/blender/source/blender/src/editipo.c	2008-03-05 17:12:09 UTC (rev 13980)
@@ -2200,8 +2200,12 @@
 			Object *ob= (Object *)id;
 			bPoseChannel *pchan= get_pose_channel(ob->pose, actname);
 			
-			*vartype= IPO_FLOAT;
-			return get_pchan_ipo_poin(pchan, icu->adrcode);
+			if(pchan) {
+				*vartype= IPO_FLOAT;
+				return get_pchan_ipo_poin(pchan, icu->adrcode);
+			}
+			else
+				return NULL;
 		}
 		return NULL;
 	}
@@ -4208,7 +4212,7 @@
 					bezt= ei->icu->bezt;
 					for(a=0; a<ei->icu->totvert; a++) {
 						if( BEZSELECTED(bezt) ) {
-							memcpy(bezt, bezt+1, (ei->icu->totvert-a-1)*sizeof(BezTriple));
+							memmove(bezt, bezt+1, (ei->icu->totvert-a-1)*sizeof(BezTriple));
 							ei->icu->totvert--;
 							a--;
 							event= 1;
@@ -5665,7 +5669,7 @@
 		return;
 	
 	/*	Delete this key */
-	memcpy(&icu->bezt[index], &icu->bezt[index+1], sizeof(BezTriple)*(icu->totvert-index-1));
+	memmove(&icu->bezt[index], &icu->bezt[index+1], sizeof(BezTriple)*(icu->totvert-index-1));
 	icu->totvert--;
 	
 	/* recalc handles - only if it won't cause problems */
@@ -5687,7 +5691,7 @@
 		/* Delete selected BezTriples */
 		for (i=0; i<icu->totvert; i++) {
 			if (icu->bezt[i].f2 & SELECT) {
-				memcpy(&icu->bezt[i], &icu->bezt[i+1], sizeof(BezTriple)*(icu->totvert-i-1));
+				memmove(&icu->bezt[i], &icu->bezt[i+1], sizeof(BezTriple)*(icu->totvert-i-1));
 				icu->totvert--;
 				i--;
 			}





More information about the Bf-blender-cvs mailing list