ogg icon indicating copy to clipboard operation
ogg copied to clipboard

Dealing with junk at the end of a file?

Open est31 opened this issue 7 years ago • 1 comments

The square-with-junk.ogg file from the libnogg test suite has junk at the end of the file. This doesn't seem to be a problem for libvorbis or libnogg. But the ogg returns an error instead of end of stream when it encounters that junk (it reads past the other junk in the file just fine).

If we want to tolerate this trailing junk, we need to be able to distinguish between a reader where we had already read valid ogg stuff, and one where we hadn't, so that we don't return "no pages" when encountering a non-ogg file. A non ogg file is different from an empty file!

This ability to distinguish requires us to store more state, and I'm not sure whether it's worth it.

est31 avatar Sep 13 '18 23:09 est31

See also https://github.com/RustAudio/lewton/commit/eb231f72d90e01fa2c0bab59e6cda87a38bf4078

est31 avatar Sep 13 '18 23:09 est31