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@blender.org>2020-11-30 17:55:52 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-30 18:24:11 +0300
commit0f30edc20c6206b40216b162fa435d23562127f8 (patch)
treeec5e4345fd0d8a818ecfa44f37300435c877410a /source/blender/blenkernel/intern/tracking_util.c
parent13ce25d24c9d667282784f34fd5e5e875b350c91 (diff)
Tracking: Make image accessor own what it needs
Previously image accessor was sharing array pointer for tracks access. Now it is possible to pass a temporary array valid only during the initialization process. Should be no functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_util.c')
-rw-r--r--source/blender/blenkernel/intern/tracking_util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c
index 7146be1d521..eb57c28de09 100644
--- a/source/blender/blenkernel/intern/tracking_util.c
+++ b/source/blender/blenkernel/intern/tracking_util.c
@@ -1021,7 +1021,10 @@ TrackingImageAccessor *tracking_image_accessor_new(MovieClip *clips[MAX_ACCESSOR
memcpy(accessor->clips, clips, num_clips * sizeof(MovieClip *));
accessor->num_clips = num_clips;
- accessor->tracks = tracks;
+
+ accessor->tracks = MEM_malloc_arrayN(
+ num_tracks, sizeof(MovieTrackingTrack *), "image accessor tracks");
+ memcpy(accessor->tracks, tracks, num_tracks * sizeof(MovieTrackingTrack *));
accessor->num_tracks = num_tracks;
accessor->libmv_accessor = libmv_FrameAccessorNew((libmv_FrameAccessorUserData *)accessor,
@@ -1040,5 +1043,6 @@ void tracking_image_accessor_destroy(TrackingImageAccessor *accessor)
IMB_moviecache_free(accessor->cache);
libmv_FrameAccessorDestroy(accessor->libmv_accessor);
BLI_spin_end(&accessor->cache_lock);
+ MEM_freeN(accessor->tracks);
MEM_freeN(accessor);
}