From 7cccb276bfa3b4a8a74d4495259c77c774891dc3 Mon Sep 17 00:00:00 2001 From: "Tristan F." Date: Sat, 12 Oct 2024 22:28:24 -0700 Subject: [PATCH] test(fuzz): cover other image types --- fuzz/Cargo.toml | 12 ++++++++++++ fuzz/fuzzers/fuzzer_script_farbfeld.rs | 7 +++++++ fuzz/fuzzers/fuzzer_script_openexr.rs | 7 +++++++ fuzz/fuzzers/fuzzer_script_qoi.rs | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100644 fuzz/fuzzers/fuzzer_script_farbfeld.rs create mode 100644 fuzz/fuzzers/fuzzer_script_openexr.rs create mode 100644 fuzz/fuzzers/fuzzer_script_qoi.rs diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index c6776b747f..7314bcf2b1 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -66,6 +66,18 @@ path = "fuzzers/fuzzer_script_hdr.rs" name = "fuzzer_script_exr" path = "fuzzers/fuzzer_script_exr.rs" +[[bin]] +name = "fuzzer_script_qoi" +path = "fuzzers/fuzzer_script_qoi.rs" + +[[bin]] +name = "fuzzer_script_openexr" +path = "fuzzers/fuzzer_script_openexr.rs" + +[[bin]] +name = "fuzzer_script_farbfeld" +path = "fuzzers/fuzzer_script_farbfeld.rs" + [[bin]] name = "roundtrip_webp" path = "fuzzers/roundtrip_webp.rs" \ No newline at end of file diff --git a/fuzz/fuzzers/fuzzer_script_farbfeld.rs b/fuzz/fuzzers/fuzzer_script_farbfeld.rs new file mode 100644 index 0000000000..b392c00161 --- /dev/null +++ b/fuzz/fuzzers/fuzzer_script_farbfeld.rs @@ -0,0 +1,7 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate image; + +fuzz_target!(|data: &[u8]| { + let _ = image::load_from_memory_with_format(data, image::ImageFormat::Farbfeld); +}); diff --git a/fuzz/fuzzers/fuzzer_script_openexr.rs b/fuzz/fuzzers/fuzzer_script_openexr.rs new file mode 100644 index 0000000000..6cfd23778f --- /dev/null +++ b/fuzz/fuzzers/fuzzer_script_openexr.rs @@ -0,0 +1,7 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate image; + +fuzz_target!(|data: &[u8]| { + let _ = image::load_from_memory_with_format(data, image::ImageFormat::OpenExr); +}); diff --git a/fuzz/fuzzers/fuzzer_script_qoi.rs b/fuzz/fuzzers/fuzzer_script_qoi.rs new file mode 100644 index 0000000000..c2bca40b78 --- /dev/null +++ b/fuzz/fuzzers/fuzzer_script_qoi.rs @@ -0,0 +1,7 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate image; + +fuzz_target!(|data: &[u8]| { + let _ = image::load_from_memory_with_format(data, image::ImageFormat::Qoi); +});