Questionable assert in org.jaudiotagger.audio.asf.io.MetadataReader#readBoolean()
Issue #219
resolved
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)
-
repo owner -
repo owner - changed status to resolved
Done
- Log in to comment
Yes, please change, I wasn't aware of this I never wrote it (I never actually use asserts except in testcode)