Closed replicant0wnz closed 4 years ago
If I could get the file itself, that'd be best. Besides just being easier to check on, the flac tools actually support reading some files that violate the spec in different ways. So, I can't be sure of the actual binary layout.
Here ya go! Just lemme know after ya grab it so I can whack it ..
Got it. Thanks.
So, yeah, almost all the Vorbis comments in that file are invalid according to the spec. Most of them are terminated with a null byte when it is clearly spelled out in the spec not to null terminate them.
Not sure what wrote those, but it's doing it wrong. This would've failed with mutagen, too, as it doesn't strip the null bytes from them either. Dunno what they end up like on Google Music if uploaded with their Music Manager, but it's possible you'd see some metadata issues then, too.
I've chosen to stick to the specs for things, but this does let me know I should add some validation and raise an exception in this case. Gonna move this issue to the audio-metadata repo for that reason.
PS Thanks for finding me more files that break things ^_^
People truly don't understand how much we programmers want/need them.
Ok, so, just for future reference, I tested with Google's Music Manager for shits and giggles. It strips null bytes somewhere along the way. Not sure I'd do that since audio-metadata would be throwing exceptions in this particular case in the future, but it's nice to know these quirks.
I don't think there's actually anything I can do about this one but pass it through. I'll probably just add a try/except to google-music-proto where the exception occurs. If I end up trying to add a number field class for vorbis comments, I could handle this particular case there.
Think I'm just gonna run my entire collection through a tag "fixer" or just write my own. Thanks for taking a look!
Quick hack:
Got a new one :-D
I added a
print
statement at line 259 ongoogle_music_proto/musicmanager/calls.py
to get the offending file. Here's the FLAC header for it (kinda big due to embedded image):http://dallaslamers.org/bad_flac.txt