Skip to content

Conversation

@jmcintyre
Copy link

When a 64bit atom size is detected, the larger size will not be retrieved after header.

@mathiascode
Copy link
Member

Thanks! This needs a sample file in https://github.com/tinytag/tinytag/blob/master/tinytag/tests/test_all.py. You can truncate an existing file to only include the header, and add it to https://github.com/tinytag/tinytag/tree/master/tinytag/tests/samples.

In order to keep the correct atom size in the debug message, I would add a data_offset variable (or similar) that contains the position of the data after the header. Once you've logged atom_size, you can subtract data_offset from it, and possibly store the result in a new variable.

atom_size = unpack('>I', atom_header[:4])[0]
if atom_size == 1: # Indicates 64 bit size value will be packed after the header
large_size_header = fh.read(large_size_len)
atom_size = unpack('>Q', large_size_header[:8])[0] - large_size_len
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[:8] is redundant in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants