openmicroscopy/bioformats — pull request #30 by ctrueden (2012-02-21 18:59:55+00:00)
Title: Planes too large

There are a lot of NegativeArraySizeExceptions being reported, as more and more people work with extremely large image planes. We can do make things easier by checking byte array allocations when they happen, particularly when the target array size is a product of multiple integers. This branch illustrates the idea, and uses it in a few key classes. It provides a more informative exception to the user, and also guards against cases where the product of ints could overflow back into positive territory (which in the current codebase would go undetected while producing erroneous behavior).