Please review at your convenience. Issue: https://bugs.openjdk.java.net/browse/JDK-8145014 Patch: http://cr.openjdk.java.net/~bpb/8145014/webrev.00/
In the locateImage() method handle zero-entry IFDs and EOFExceptions, hopefully returning the correct viable number of leading images in the stream with any bogus ones at the end being ignored. Thanks, Brian