mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive list: make deep copy of picture list on merge
On merging make a deep copy of the picture list, to avoid a use-after-free crash after the orginal dive is deleted. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
471fc1dfc8
commit
207ca0f94e
1 changed files with 1 additions and 1 deletions
|
@ -3475,7 +3475,7 @@ struct dive *merge_dives(const struct dive *a, const struct dive *b, int offset,
|
|||
MERGE_MAX(res, a, b, number);
|
||||
MERGE_NONZERO(res, a, b, cns);
|
||||
MERGE_NONZERO(res, a, b, visibility);
|
||||
MERGE_NONZERO(res, a, b, picture_list);
|
||||
STRUCTURED_LIST_COPY(struct picture, a->picture_list ? a->picture_list : b->picture_list, res->picture_list, copy_pl);
|
||||
taglist_merge(&res->tag_list, a->tag_list, b->tag_list);
|
||||
merge_cylinders(res, a, b, cylinders_map_a, cylinders_map_b);
|
||||
merge_equipment(res, a, b);
|
||||
|
|
Loading…
Add table
Reference in a new issue