Commit: ca25fe98fca8bed1de98c9bf6b899358e8500286
Author: Sergey Sharybin
Date:   Mon Dec 15 14:31:19 2014 +0500
Branches: master
https://developer.blender.org/rBca25fe98fca8bed1de98c9bf6b899358e8500286

Tracking: Fix possible race condition accessing the tracks

Writing to the tracks was already inside the lock section, but
reading was not. This could have lead to race condition leading
to all sorts of weird and wonderful artifacts.

===================================================================

M       source/blender/blenkernel/intern/tracking_auto.c

===================================================================

diff --git a/source/blender/blenkernel/intern/tracking_auto.c 
b/source/blender/blenkernel/intern/tracking_auto.c
index 55b8f0b..f4601d6 100644
--- a/source/blender/blenkernel/intern/tracking_auto.c
+++ b/source/blender/blenkernel/intern/tracking_auto.c
@@ -383,13 +383,17 @@ bool BKE_autotrack_context_step(AutoTrackContext *context)
                int frame = BKE_movieclip_remap_scene_to_clip_frame(
                        context->clips[options->clip_index],
                        context->user.framenr);
+               bool has_marker;
 
-               if (libmv_autoTrackGetMarker(context->autotrack,
-                                            options->clip_index,
-                                            frame,
-                                            options->track_index,
-                                            &libmv_current_marker))
-               {
+               BLI_spin_lock(&context->spin_lock);
+               has_marker = libmv_autoTrackGetMarker(context->autotrack,
+                                                     options->clip_index,
+                                                     frame,
+                                                     options->track_index,
+                                                     &libmv_current_marker);
+               BLI_spin_unlock(&context->spin_lock);
+
+               if (has_marker) {
                        if (!tracking_check_marker_margin(&libmv_current_marker,
                                                          
options->track->margin,
                                                          context->frame_width,

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

Reply via email to