mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-27 10:30:34 +00:00
Cover bounded PNG header probing
This commit is contained in:
@@ -165,6 +165,8 @@ mod tests {
|
||||
chunk(&mut bytes, b"eXIf", exif);
|
||||
chunk(&mut bytes, b"IEND", &[]);
|
||||
assert_eq!(header(&bytes).ok(), Some((2, 3, 6)));
|
||||
assert!(matches!(header_with_max_pixels(&bytes, 5), Err(CodecError::LimitExceeded(_))));
|
||||
assert_eq!(declared_dimensions(&bytes), Some((2, 3)));
|
||||
assert!(header(&bytes[..34]).is_err());
|
||||
let mut indexed = png(3);
|
||||
chunk(&mut indexed, b"IDAT", &[1]);
|
||||
|
||||
Reference in New Issue
Block a user