diff --git a/src/decoder/image.rs b/src/decoder/image.rs index 67334f6..a4a9189 100644 --- a/src/decoder/image.rs +++ b/src/decoder/image.rs @@ -215,6 +215,12 @@ impl Image { .unwrap_or(height); strip_decoder = Some(StripDecodeState { rows_per_strip }); tile_attributes = None; + + if chunk_offsets.len() != chunk_bytes.len() { + return Err(TiffError::FormatError( + TiffFormatError::InconsistentSizesEncountered, + )); + } } (false, false, true, true) => { chunk_type = ChunkType::Tile;