mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
Cover bounded PNG header probing
This commit is contained in:
1 parent
e4cef773fc
commit
188d935887
1 file changed
+2
@@ -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