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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-17 12:20:21 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-17 12:20:21 +0400
commit0cc2966516605a4c6bde7b83f072bb4be7e4a9e4 (patch)
treebc70ae7d04650ac57e16d4ddd8bbc68cb314a385
parent026bbecb8fb3e09b6144a580f101432497d12fe2 (diff)
parentaa747f588936899bf56fa7142a936eafcd7d822d (diff)
Camera tracking: fixed issue when track used for rotation stabilization points to a freed memory after re-tracking this track.
-- svn merge -r44148:44149 ^/branches/soc-2011-tomato
-rw-r--r--source/blender/blenkernel/intern/tracking.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index f089aae578b..c9e6ecf6394 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -726,6 +726,7 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
{
MovieTrackingTrack *track;
MovieTrackingTrack *act_track= BKE_tracking_active_track(tracking);
+ MovieTrackingTrack *rot_track= tracking->stabilization.rot_track;
ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL};
ListBase *old_tracks;
int a;
@@ -747,7 +748,7 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
this is needed to keep names in unique state and it's faster to change names
of currently operating tracks (if needed) */
for(a= 0; a<map->num_tracks; a++) {
- int replace_sel= 0;
+ int replace_sel= 0, replace_rot= 0;
MovieTrackingTrack *new_track, *old;
track= &map->tracks[a];
@@ -766,8 +767,10 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
/* original track was found, re-use flags and remove this track */
if(cur) {
- if(act_track)
+ if(cur==act_track)
replace_sel= 1;
+ if(cur==rot_track)
+ replace_rot= 1;
track->flag= cur->flag;
track->pat_flag= cur->pat_flag;
@@ -786,6 +789,9 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
if(replace_sel) /* update current selection in clip */
tracking->act_track= new_track;
+ if(replace_rot) /* update track used for rotation stabilization */
+ tracking->stabilization.rot_track= new_track;
+
BLI_addtail(&tracks, new_track);
}