Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-03-05 20:12:09 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-03-05 20:12:09 +0300
commit8b5933af4eb12af2dd49285d1925deeae57d67b1 (patch)
treea9939045ba263902c7e15e35629a896ab35bd64b /source
parent4f764637e6603d8dee324031944772db05c11058 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/editipo.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index dab2a0398b7..81a4a37581f 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -2200,8 +2200,12 @@ static void *get_context_ipo_poin(ID *id, int blocktype, char *actname, IpoCurve
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 @@ void del_ipo(int need_check)
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 @@ void delete_icu_key(IpoCurve *icu, int index, short do_recalc)
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 @@ void delete_ipo_keys(Ipo *ipo)
/* 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--;
}