Several functions accept a buffer size but never actually check whether
the buffer overflows during reading/writing. This fixes all cases where
a size variable has explicitly been marked as unused (through a (void)
cast).
This was discovered while investigating an assertion caused by
7cc691f332f26802c64cdc47e17bff8b_signal_sigabrt_7ffff6d59425_2247_2509.pdf
among others.
Thanks to Mateusz Jurczyk and Gynvael Coldwind of the Google Security
Team for providing the example files.
r2077 did expose too much of the detail implementation of OpenJPEG. Rework dependencies in between JPIP file level details and JPIP client/server arch.
Move JPIP file level functionalities back into OpenJP2 as was the case in openjpeg 1.5.x. Use new cio func.