Implement cycle checking in IFD offsets

This commit is contained in:
5225225 committed 2021-09-08 18:08:10 +01:00
1 parent 2c9e02d347
commit 885d762def
3 files changed
+17 -18

No files matched your search

+2
View File
@@ -64,6 +64,7 @@ pub enum TiffFormatError {
Format(String),
RequiredTagEmpty(Tag),
StripTileTagConflict,
CycleInOffsets,
#[doc(hidden)]
/// Do not match against this variant. It may get removed.
__NonExhaustive,
@@ -115,6 +116,7 @@ impl fmt::Display for TiffFormatError {
Format(ref val) => write!(fmt, "Invalid format: {:?}.", val),
RequiredTagEmpty(ref val) => write!(fmt, "Required tag {:?} was empty.", val),
StripTileTagConflict => write!(fmt, "File should contain either (StripByteCounts and StripOffsets) or (TileByteCounts and TileOffsets), other combination was found."),
CycleInOffsets => write!(fmt, "File contained a cycle in the list of IFDs"),
__NonExhaustive => unreachable!(),
}
}