mutagen icon indicating copy to clipboard operation
mutagen copied to clipboard

unpack requires a buffer of 8 bytes

Open alucryd opened this issue 2 years ago • 3 comments

Hi guys, trying to import my library into beets, I'm getting a lot of 'unreadable' m4a files, even though they're perfectly fine. Trying mutagen-inspect on them returns the error in the title. I'm using version 1.45.1 on Arch Linux with Python 3.10. Is that maybe a problem running on Python 3.10? Happy to provide more details or one of the files for testing.

alucryd avatar Jun 22 '22 21:06 alucryd

I've just added Python 3.10 testing to CI and everything seems to work fine.

You can send me a file to [email protected] (or post it publicly if there are not copyright issues)

lazka avatar Jul 16 '22 15:07 lazka

Thanks, the first file (1.01) fails with:

Traceback (most recent call last):
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 1203, in load
    self.chapters = self.MP4Chapters(atoms, fileobj)
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 923, in __init__
    self.load(*args, **kwargs)
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 947, in load
    self._parse_chpl(chpl, fileobj)
  File "/mnt/c/msys64/home/user/git/mutagen/mutagen/mp4/__init__.py", line 991, in _parse_chpl
    start = struct.unpack(">Q", data[pos:pos + 8])[0] / 10000
struct.error: unpack requires a buffer of 8 bytes

It's a mutagen bug that this error is handled properly, but needs investigating if the file is broken or not.

The second file (1.03) works fine for me (also using Python 3.10).

lazka avatar Oct 24 '22 18:10 lazka

FWIW the files play fine, and they were all originally managed by beets (both working and non working files). I can try to retag them with another software, see if that helps.

alucryd avatar Oct 31 '22 10:10 alucryd