Closed GoogleCodeExporter closed 9 years ago
The file is corrupt.
Metadata block #1 (as reported by metaflac) has a length of 48 bytes which I
assure
you is too small to encapsulate the vorbis comment block that is contained
nevertheless intact within the file.
I managed to fix the file using a hex editor and writing at address 2D(hex) the
value
AF(hex) for 175 bytes, the actual payload size.
I was able to successfully read the metadata using mutagen afterwards.
Fixed file is attached.
Original comment by nondicti...@gmail.com
on 10 Jan 2010 at 11:19
Attachments:
The FLAC file is absolute garbage; the Vorbis metadata block claims it's 48
bytes
long, which is just wrong. If it was 36 bytes I'd say it wrote out the reference
string header length + reference string + 0 frame count and that's how it got
36, and
then didn't make the tag larger when it added the actual TITLE etc. tags. But
it's
48, which doesn't make any sense.
I could probably hack up something that makes sure the FLAC block size matched
the
Vorbis comment size (it's really easy in this case - 48 bytes is obviously not
enough
to contain 4 byte length + 32 byte vendor + 4 bytes count + min. 6 * 5 bytes
tags),
but while it's easy to detect, I'm not sure I want to try to work around it,
because
it's harder to fix than to detect.
I'll look at the source for libFLAC, because it seems to have some kind of
workaround
for this. Which is probably why EasyTag can load it.
Original comment by joe.wreschnig@gmail.com
on 11 Jan 2010 at 12:14
libFLAC's support is not intentional AFAICT. It just slurps data linearly, so
although it reads 48 bytes for the Vorbis comment, it throws that out and
assumes
that parsing the Vorbis comment itself will give it the correct size. I checked
in a
change to make Mutagen do a synch flag check at what it thinks is the start of
the
audio data, which should allow us to back-patch the correct block size after
parsing,
once I figure out if there's an API-compatible way to route the original fileobj
through all the MetadataBlock constructors.
Original comment by joe.wreschnig@gmail.com
on 11 Jan 2010 at 1:09
After poking at this for several hours I'm very reluctant to try to code a
workaround
into the FLAC loader in Mutagen. I've never seen this bug before and the code
would
be tricky given the way the FLAC loader is currently written. A rewrite of the
FLAC
metadata loader could support it but until/if we make mutagen.flac2 this is out
of
the question, I think.
The good news is that it should be easy to write a standalone script that knows
how
to fixup these files just by looking for the FLAC comment header and scanning
the
Vorbis comment size, no Mutagen involved.
Original comment by joe.wreschnig@gmail.com
on 18 Jan 2010 at 12:27
Here is another one: http://code.google.com/p/quodlibet/issues/detail?id=465#c5
(line_65.flac)
This one fails now because of the "End of metadata did not start audio" check.
The last block is a padding with a valid length but with garbage after it.
And I would guess that libFLAC ignores last blocks which are padding.
Original comment by reiter.christoph@gmail.com
on 21 Mar 2010 at 3:46
And line_66.flac is again one of those 48 bytes files.
Original comment by reiter.christoph@gmail.com
on 21 Mar 2010 at 3:58
I have a mostly-working fix for this, but I think it's getting worse. Someone
on IRC showed me this file yesterday, which looks like it was a
not-really-48-byte file, and then something tried to tag it as if it was,
leaving garbage data after the last metadata block.
ogg123 will still play them, though, so we'll try to parse them. But we can't
fix them without risking intruding on the audio data.
Original comment by joe.wreschnig@gmail.com
on 19 May 2011 at 1:20
Attachments:
This issue was closed by revision r108.
Original comment by joe.wreschnig@gmail.com
on 24 May 2011 at 4:44
Issue 121 has been merged into this issue.
Original comment by reiter.christoph@gmail.com
on 29 Aug 2012 at 3:58
Original issue reported on code.google.com by
reiter.christoph@gmail.com
on 10 Jan 2010 at 10:29Attachments: