Fix crash when trying to track disabled track.
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 4 Dec 2011 10:57:36 +0000 (10:57 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 4 Dec 2011 10:57:36 +0000 (10:57 +0000)
This is possible fixes #29498: Seg fault on trying to track byond clip length

source/blender/editors/space_clip/tracking_ops.c

index 89c58ab5d81a0d56609b2f3be705fb66ebfbe1a9..3d004ab73da2d73cf723a5a3a44e0090e7716c91 100644 (file)
@@ -1209,11 +1209,16 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip)
 {
        int tot= 0;
        MovieTrackingTrack *track;
+       int framenr= sc->user.framenr;
 
        track= clip->tracking.tracks.first;
        while(track) {
-               if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0)
-                       tot++;
+               if(TRACK_VIEW_SELECTED(sc, track) && (track->flag&TRACK_LOCKED)==0) {
+                       MovieTrackingMarker *marker= BKE_tracking_exact_marker(track, framenr);
+
+                       if (!marker || (marker->flag&MARKER_DISABLED) == 0)
+                               tot++;
+               }
 
                track= track->next;
        }