Questionable assert in org.jaudiotagger.audio.asf.io.MetadataReader#readBoolean()

Issue #219 resolved
Hendrik Schreiber created an issue

In org.jaudiotagger.audio.asf.io.MetadataReader#readBoolean() we read x bytes from an InputStream. In theory, all bytes have to be 0, except the last one, that may also be 1.

This constraint is enforced via assert statements.

This means, that whenever JAudioTagger encounters a slightly malformed file, an AssertionError is thrown, potentially killing the process.

To me this seems overkill, especially while reading.

Why not either ignore all values except the last one or simply throw an exception?

Comments (2)

  1. IJabz repo owner

    Yes, please change, I wasn't aware of this I never wrote it (I never actually use asserts except in testcode)

  2. Log in to comment