fix(content): bound remote resource usage

This commit is contained in:
objz committed 2026-08-04 21:02:35 +02:00
1 parent bf2957e75b
commit d488954548
7 files changed
+82 -7

No files matched your search

+8
View File
@@ -555,6 +555,14 @@ fn gif_images_decode_their_first_frame() {
assert_eq!(image.height(), 1);
}
#[test]
fn oversized_images_are_rejected_before_decoding() {
let image = image::DynamicImage::new_rgba8(super::MAX_PROJECT_IMAGE_DIMENSION + 1, 1);
let mut bytes = std::io::Cursor::new(Vec::new());
image.write_to(&mut bytes, image::ImageFormat::Png).unwrap();
assert!(super::decode_image(bytes.get_ref()).is_err());
}
#[test]
fn image_rows_align_fitted_images_to_the_bottom() {
let picker = ratatui_image::picker::Picker::halfblocks();