[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata

Adam Rosi-Kessel adam at rosi-kessel.org
Wed Jun 24 20:24:24 PDT 2009


Adam Rosi-Kessel wrote, on 6/21/2009 9:29 AM:
> Conrad Parker wrote, on 6/20/2009 10:24 PM:
>>> How about another approach -- is there a tool that will verify the page
>>> checksums? oggz-validate doesn't seem to do this. If the page checksums
>>> are okay, then doesn't that suggest the streams are also recoverable?
>> If the page checksums are bad then the page will get rejected by
>> libogg, and oggz-validate won't even see it (or its packets). "hogg
>> dumpraw" will at least show the page CRC and segment table, before
>> verifying the CRC, which could be useful.
>
> Does it actually check the CRC, or is there some way for me to do so? I
> see the output from hogg dumpraw, but am not sure how to interpret it.
>
> In other news, the MediaMonkey developers believe this is a bug in a
> (possibly) older version of vorbis_comment_add_tag():
>
> http://www.ventismedia.com/mantis/view.php?id=5809
>
> Does this seem right and/or shed any light on how to undo the damage?

One other potentially interesting observation -- 
Ogg::Vorbis::Header::PurePerl has no trouble reading the headers on 
these corrupted files (and outputting the contents correctly), while 
Ogg::Vorbis::Header dies. Unfortunately, the PurePerl module doesn't 
have any functions implemented to delete metadata -- if it did, I would 
try using that to clear out the tags. But I wonder if the difference 
between the two implementations provides a clue for how to fix this.

I also took a stab at hacking on hogg, but I couldn't figure out what 
was different about what you were recommending than the existing sort 
function there.

Adam


More information about the ogg-dev mailing list