mirror of
https://github.com/taglib/taglib.git
synced 2026-10-28 10:58:49 -04:00
1ae164e382f567c463d14b7bd782b3fe10516685
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.
TagLib
TagLib Audio Metadata Library
TagLib is a library for reading and editing the metadata of several popular audio formats. Currently, it supports various metadata containers such as ID3v1, ID3v2 and Vorbis comments for MP3, MP4, AAC, Ogg, Opus, FLAC, Speex, APE, MPC, WavPack, WAV, AIFF, TrueAudio, Matroska, WebM, ASF, WMA, DSF, DFF and tracker (MOD, XM, S3M, IT) files.
TagLib is distributed under the GNU Lesser General Public License (LGPL) and Mozilla Public License (MPL). Essentially that means that it may be used in proprietary applications, but if changes are made to TagLib they must be contributed back to the project. Please review the licenses if you are considering using TagLib in your project.
Languages
C++
96.7%
CMake
2%
C
0.9%
Logos
0.4%