Fix reading bad SubIFDs again

This commit is contained in:
Oliver Schmidtmer 2016-02-16 22:52:57 +01:00
parent 672aa1a048
commit 6796910091

View File

@ -105,17 +105,28 @@ public final class EXIFReader extends MetadataReader {
}
for (int i = 0; i < entryCount; i++) {
try {
EXIFEntry entry = readEntry(pInput);
if (entry != null) {
entries.add(entry);
}
}
catch (IIOException e) {
break;
}
}
if (readLinked) {
if (nextOffset == -1) {
try {
nextOffset = pInput.readUnsignedInt();
}
catch (EOFException e) {
// catch EOF here as missing EOF marker
nextOffset = 0;
}
}
// Read linked IFDs
if (nextOffset != 0) {