cantaloupe
cantaloupe copied to clipboard
Fix some unsafe reads.
If they failed to read the number of bytes, the return of -1
would cause infinite loops, with -1
always less than the minimum offset
of 0
.
An alternative to #551 fixing #550, and more, touching on https://github.com/cantaloupe-project/cantaloupe/pull/551#discussion_r1427377512
Did a bit of a grep
around for similar broken patterns which should get a similar fix; though, there may be some others. In particular, suspicious of this bit of JPEG2000KakaduImageReader
, but not terribly sure on the expectations around it, and don't use Kakadu.