mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 17:27:19 +00:00
Use a BMP size supported by the baseline decoder
This commit is contained in:
@@ -277,12 +277,11 @@ mod stored_size_tests {
|
||||
#[test]
|
||||
fn stored_probe_uses_caller_limits_without_decoding() {
|
||||
let mut bmp = Cursor::new(Vec::new());
|
||||
image::write_buffer_with_format(&mut bmp, &vec![0; 300_000 * 3], 1, 300_000, image::ExtendedColorType::Rgb8, image::ImageFormat::Bmp)
|
||||
.unwrap();
|
||||
image::write_buffer_with_format(&mut bmp, &vec![0; 60_000 * 3], 1, 60_000, image::ExtendedColorType::Rgb8, image::ImageFormat::Bmp).unwrap();
|
||||
let bytes = bmp.into_inner();
|
||||
let limits = crate::Limits::new(u32::MAX, u32::MAX, 128_000_000, 2_048_000_000);
|
||||
assert_eq!(probe_stored_size(&bytes, &limits).unwrap(), (1, 300_000));
|
||||
assert!(probe_stored_size(&bytes, &crate::Limits::default()).is_err());
|
||||
assert_eq!(probe_stored_size(&bytes, &limits).unwrap(), (1, 60_000));
|
||||
assert!(probe_stored_size(&bytes, &crate::Limits::new(u32::MAX, 50_000, u64::MAX, 2_048_000_000)).is_err());
|
||||
assert!(probe_stored_size(&bytes[..20], &limits).is_err());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user