File of type ".ogg" can be read, but not written to

Issue #275 resolved
Andreas Kromke created an issue

When trying to change this file:

https://archive.org/download/NorthTahoeHighSchoolRegionFiveHonorBandSaturdayNovember212009/01-AnAmericanFanfare.ogg

this failure occurs:

org.jaudiotagger.audio.exceptions.CannotReadException: OggS Header could not be found, not an ogg stream ��������
    at org.jaudiotagger.audio.ogg.util.OggPageHeader.read(OggPageHeader.java:168)
    at org.jaudiotagger.audio.ogg.OggVorbisTagReader.readOggVorbisHeaderSizes(OggVorbisTagReader.java:456)
    at org.jaudiotagger.audio.ogg.OggVorbisTagWriter.write(OggVorbisTagWriter.java:94)
    at org.jaudiotagger.audio.ogg.OggFileWriter.writeTag(OggFileWriter.java:45)
    at org.jaudiotagger.audio.generic.AudioFileWriter.write(AudioFileWriter.java:400)
    at org.jaudiotagger.audio.AudioFileIO.writeFile(AudioFileIO.java:489)
    at org.jaudiotagger.audio.AudioFileIO.write(AudioFileIO.java:212)
    at org.jaudiotagger.audio.AudioFile.commit(AudioFile.java:115)

Comments (4)

  1. Martin Castillo

    " not an ogg stream ��������"

    these characters are actually 4 times 0xC0 0x80, i.e. utf-8 encoding for \x00. maybe unrelated but worth mentioning: this is the ogg stream serial number of the vorbis stream in the ogg file. This is unusual but not prohibited afaik. looking into the relevant source code the parser somehow lands somewhere, where there are 4 0-bytes instead of the OggS capture pattern. to debug this it would be useful to know at what file offset it found the unexpected byte sequence.

  2. Martin Castillo

    After manually parsing it I think the problem is at offset 0x124. the previous page stops there, but somehow there is some other binary data other than an ogg header. Can someone verify this? If this is true, the file is corrupted/ has junk between the second and third page.

    But ffmpeg -i corrupt.ogg -c copy good.ogg is able to rescue the vorbis metadata. So I'm unsure whether the file is really corrupted.

  3. Martin Castillo

    https://gitlab.com/LineageOS/issues/android/issues/57

    I reported another issue with this file at lineage.

    As my comment there states, the file has some garbage between two valid ogg pages. it is easy for the ogg demuxer to ignore it. while this is reasonable for reading/playing the file, one could argue that editing such a file might not be wanted: if jaudiotagger has some bug that causes it to think a specific valid file is broken, it would try to correct the 'broken' file and remove parts of a valid file.

    feel free to close this bug

  4. Log in to comment