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>2014-12-15 12:31:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-12-15 12:31:19 +0300
commitca25fe98fca8bed1de98c9bf6b899358e8500286 (patch)
tree77fcf71e94cd8f56e514c559f56ff4a9df0ae0cb
parentae6f62c4e2090ea8987bad9af67fad33cbe55966 (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/tracking_auto.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/tracking_auto.c b/source/blender/blenkernel/intern/tracking_auto.c
index 55b8f0bd3ab..f4601d66405 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,