Skip to content

Commit a0a3407

Browse files
authored
Handle CRC-32 element in SeekHead
According to the specifications Top Level elements should include a CRC-32 element as a child segment. (http://matroska-org.github.io/matroska-specification/ordering.html) A SeekHead is a top level element (https://matroska.org/technical/specs/index.html) This patch handles a CRC-32 element if found in a SeekHead, don't return false otherwise the SeekHead is marked a corrupted and metadata is never written to the file while saving.
1 parent ee5ab21 commit a0a3407

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/TagLib/Matroska/File.cs

+6
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,12 @@ private bool ReadSeekHead(EBMLreader element, List<EBMLreader> segm_list)
744744
EBMLreader ebml_seek = new EBMLreader(element, element.DataOffset + i);
745745
MatroskaID matroska_id = ebml_seek.ID;
746746

747+
if (matroska_id == MatroskaID.CRC32) // Skip the CRC-32 element
748+
{
749+
i += ebml_seek.Size;
750+
continue;
751+
}
752+
747753
if (matroska_id != MatroskaID.Seek) return false; // corrupted SeekHead
748754

749755
ulong j = 0;

0 commit comments

Comments
 (0)