Add consistency check between StripOffsets and StripByteCounts

This commit is contained in:
Jonathan Behrens committed 2022-01-12 19:56:08 -05:00
1 parent 7a7d4f0305
commit bc2055243a
1 file changed
+6
+6
View File
@@ -215,6 +215,12 @@ impl Image {
.unwrap_or(height); .unwrap_or(height);
strip_decoder = Some(StripDecodeState { rows_per_strip }); strip_decoder = Some(StripDecodeState { rows_per_strip });
tile_attributes = None; tile_attributes = None;
if chunk_offsets.len() != chunk_bytes.len() {
return Err(TiffError::FormatError(
TiffFormatError::InconsistentSizesEncountered,
));
}
} }
(false, false, true, true) => { (false, false, true, true) => {
chunk_type = ChunkType::Tile; chunk_type = ChunkType::Tile;