-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OGG Vorbis file save fails: mutagen.ogg.error: unable to read full header; got b'\x00\x00' #591
Comments
Without a file to look into it's not really possible to say much about this. mutagen fails reading an ogg page header inside the file, so it looks like there is at least some corrupted data structure inside the file. |
I have the same issue and have a file I can share. How can I share you the file privately? |
Ran into the same issue. mutagen_file.save(padding=lambda info: 0) Ref.: https://mutagen.readthedocs.io/en/latest/user/padding.html Attached below is a test file and a minimal example to reproduce the issue import mutagen
file_path = "Sinewave_Sweep.ogg"
mutagen_handle = mutagen.File(file_path)
mutagen_handle["artist"] = u'AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB'
mutagen_handle["title"] = u'CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDD'
mutagen_handle["album"] = u'EEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFF'
mutagen_handle["comment"] = u'GGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHH'
mutagen_handle.save() From my example It always throws at the last Ogg page, trying to interpret the last couple null bytes as a header. However, the offsets also wildly change. On the file that errored previously the last two segments are now The same error will return once if you massively increase the size of the metadata (say * 100 for each tag). Couldn't tell what about my file is corrupt though. I hope someone more familiar with the format can spot the problem :) |
The library is not handling trailing null bytes in the file, not even sure in which cases The fix applies when all the trailing bytes are null bytes so the check would essentially look like this instead of the if all(not byte in header):
if not all(not byte in fileobj.read()):
raise error("non-null bytes trailing at %d" % self.offset) |
Good day,
I am trying to save meta data to an Ogg Vorbis file that currently has no . I only have problems with this file. Unfortunately, I don't know where it is from.
My code to write a tag to this file:
It throws the following error (incl. stack trace)
Before and after running the code above, I ran several ´oggz` commands to help with debugging:
Before running:
After running:
I tried to understand the code, but I was not able to find the mistake or bad section in my file, nor what generally happens. Maybe somebody knows what is wrong with my file.
I unfortunately cannot provide the (corrupt?) file due to copyright. Also, I don't have any other files than that. But maybe you can guide me through debugging this issue.
The text was updated successfully, but these errors were encountered: