Martin Leese
2009-Jul-15 19:29 UTC
[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata
Adam Rosi-Kessel <adam at rosi-kessel.org> wrote:> So I've written a script to do the following:... I have got lost. Did you manage to identify the rogue software that corrupted the files in the first place? In the greater scheme of things, fixing this (prevention) is more important than repairing the files (cure). Regards, Martin -- Martin J Leese E-mail: martin.leese stanfordalumni.org Web: http://members.tripod.com/martin_leese/
Adam Rosi-Kessel
2009-Jul-15 19:39 UTC
[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata
Martin Leese wrote, on 7/15/2009 3:29 PM:> Adam Rosi-Kessel<adam at rosi-kessel.org> wrote: > >> So I've written a script to do the following: > ... > > I have got lost. Did you manage to identify the > rogue software that corrupted the files in the > first place? In the greater scheme of things, > fixing this (prevention) is more important than > repairing the files (cure).Yes, it was Mediamonkey. They claim that it was due to a bug in vorbis libraries. The latest development version (yet to be released) supposedly has fixed the bug. I haven't been able to get any more detail about what they think the bug was or how it was fixed. Adam
Erik de Castro Lopo
2009-Jul-15 23:39 UTC
[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata
Adam Rosi-Kessel wrote:> Yes, it was Mediamonkey. They claim that it was due to a bug in vorbis > libraries.All software has bugs, but this explanation doesn't really add up. libvorbis is the codec. If they had blamed libogg, which does the container, then yes, that would have been a believable explanation :-). Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Adam Rosi-Kessel
2009-Jul-21 13:28 UTC
[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata
Martin Leese wrote, on 7/15/2009 3:29 PM:> Adam Rosi-Kessel<adam at rosi-kessel.org> wrote: > >> So I've written a script to do the following: > ... > > I have got lost. Did you manage to identify the > rogue software that corrupted the files in the > first place? In the greater scheme of things, > fixing this (prevention) is more important than > repairing the files (cure).I finally got something like an explanation from the Mediamonkey developers. Here is their explanation as to why MM corrupted my files: > the problem was caused by the fact that Vorbis library uses alloca() > function on several places, which allocates memory on stack. We > changed it to alloc() and free() functions pair instead, which fixes > the problem. I suppose that it can easily happen to any other > application using Vorbis library, but the real problem depends on > stack settings of the particular application. In any case, I think it > might make sense for Vorbis developers to make this change. I'm not sure exactly what to make of this, but it sounds perhaps like a stack overflow issue? Adam
Erik de Castro Lopo
2009-Jul-21 22:27 UTC
[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata
Adam Rosi-Kessel wrote:> I finally got something like an explanation from the Mediamonkey > developers. Here is their explanation as to why MM corrupted my files: > > > the problem was caused by the fact that Vorbis library uses alloca() > > function on several places, which allocates memory on stack. We > > changed it to alloc() and free() functions pair instead, which fixes > > the problem. I suppose that it can easily happen to any other > > application using Vorbis library, but the real problem depends on > > stack settings of the particular application. In any case, I think it > > might make sense for Vorbis developers to make this change. > > I'm not sure exactly what to make of this, but it sounds perhaps like a > stack overflow issue?On some platforms (I think windows is one) the alloc() implemetation is buggy. Those kinds of bugs can cause all sorts of problems. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/