Files
taglib/tests
Ryan FrancesconiandGitHub 1ae164e382 Matroska: Place new elements correctly when AvoidInsert moves an element (#1470)
When a save with WriteStyle::AvoidInsert moved an existing element to the
end of the segment and also added a new element, the new element was
written past the end of the file. New elements are given the old end of
the file as their offset before rendering, and that offset is then shifted
by the size change of each moved element, while the pass which lays out
the moved elements after rendering did not include the new ones.

This happens, for example, when the tags before the first cluster grow
beyond their slot and an attachment is added in the same save. The file
is left with zero bytes between the last element and the new one, the
segment size does not cover the new element, and the seek head points to
the wrong position, so the attachment cannot be read back.

The new elements are now laid out together with the moved elements,
contiguously up to the end of the segment, and their seek head entries are
updated as well.

testSaveTypesMoveAndAdd grows the tags of tags-before-cues.mkv and adds
an attachment in one AvoidInsert save, then checks that the cluster did
not move, that the children of the segment run contiguously to its
declared end, which is the end of the file, and that the tag and the
attachment read back.
2026-10-27 05:05:35 +01:00
..
2024-01-21 20:46:27 +01:00
2023-09-16 08:22:36 +02:00
2023-09-16 08:22:36 +02:00
2023-09-16 08:22:36 +02:00
2023-09-16 08:22:36 +02:00
2023-09-16 08:22:36 +02:00
2024-01-21 20:46:27 +01:00
2023-12-07 05:00:00 +01:00
2023-09-16 08:22:36 +02:00
2023-12-18 17:29:39 +01:00
2026-03-31 11:14:44 -05:00
2023-12-07 05:00:00 +01:00
2023-09-16 08:22:36 +02:00
2023-09-16 08:22:36 +02:00
2023-09-16 08:22:36 +02:00
2023-12-07 05:00:00 +01:00