Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/TaglibSharp/IFD/IFDReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,12 @@ uint ReadIFD (long baseOffset, uint offset, uint maxOffset)

IFDEntry entry;

try
{
entry = CreateIFDEntry(entry_tag, type, value_count, baseOffset, offset_data, maxOffset);
}
catch (OverflowException)
{
try {
entry = CreateIFDEntry (entry_tag, type, value_count, baseOffset, offset_data, maxOffset);
} catch (OverflowException) {
// This exception occurs when the image does not have data in the expected format at the
// requested location. This has been observed in images taken with an Olympus camera.
file.MarkAsCorrupt("Invalid IFD entry");
file.MarkAsCorrupt ("Invalid IFD entry");
continue;
}

Expand Down Expand Up @@ -549,7 +546,7 @@ IFDEntry CreateIFDEntry (ushort tag, ushort type, uint count, long baseOffset, B
file.MarkAsCorrupt ("Invalid item type");
return null;
}

return null;
// TODO: We should ignore unreadable values, erroring for now until we have sufficient coverage.
throw new NotImplementedException ($"Unknown type/count {type}/{count} ({offset})");
}
Expand Down