Revision: 44149
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44149
Author:   nazgul
Date:     2012-02-16 13:15:01 +0000 (Thu, 16 Feb 2012)
Log Message:
-----------
Tomato: fixed issue when track used for rotation stabilization points to a 
freed memory after re-tracking this track.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2012-02-16 13:14:49 UTC (rev 44148)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2012-02-16 13:15:01 UTC (rev 44149)
@@ -726,6 +726,7 @@
 {
        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 @@
           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 @@
 
                        /* 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 @@
                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);
        }
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to