diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-09 04:34:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-09 07:49:32 +0300 |
commit | 71da3f31d4972a2b3a519f201d955606ad66dd02 (patch) | |
tree | bea277efcadda008a6355280549b3951c59302e7 /source/blender/blenkernel | |
parent | 3d7e3d5ad0b4a6b790eb95076394948f5a0e046e (diff) |
Fix use of uninitialized memory in BKE_scene_objects_as_gset
Share macro for setting BLI_Iterator defaults to ensure
this doesn't happen again in cases the ITER_* macros aren't used.
Oversight in 14d74fb34174a91190d35d7fe595f8dd64cb79d1.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 8e4633cbe15..e7e978aaf9b 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -2033,8 +2033,9 @@ void BKE_scene_collections_iterator_begin(BLI_Iterator *iter, void *data_in) CollectionsIteratorData *data = MEM_callocN(sizeof(CollectionsIteratorData), __func__); data->scene = scene; + + BLI_ITERATOR_INIT(iter); iter->data = data; - iter->valid = true; scene_collections_array(scene, (Collection ***)&data->array, &data->tot); BLI_assert(data->tot != 0); @@ -2079,6 +2080,8 @@ typedef struct SceneObjectsIteratorData { static void scene_objects_iterator_begin(BLI_Iterator *iter, Scene *scene, GSet *visited_objects) { SceneObjectsIteratorData *data = MEM_callocN(sizeof(SceneObjectsIteratorData), __func__); + + BLI_ITERATOR_INIT(iter); iter->data = data; /* Lookup list to make sure that each object is only processed once. */ |