Add Picture/PictureInformation fuzz targets

This commit is contained in:
Serial 2022-01-02 21:09:01 -05:00
parent 010b60b889
commit db72b1f1a4
7 changed files with 62 additions and 1 deletions

View file

@ -52,4 +52,28 @@ path = "fuzz_targets/vorbisfile_read_from.rs"
[[bin]]
name = "wavfile_read_from"
path = "fuzz_targets/wavfile_read_from.rs"
path = "fuzz_targets/wavfile_read_from.rs"
[[bin]]
name = "pictureinformation_from_jpeg"
path = "fuzz_targets/pictureinformation_from_jpeg.rs"
[[bin]]
name = "pictureinformation_from_png"
path = "fuzz_targets/pictureinformation_from_png.rs"
[[bin]]
name = "picture_from_reader"
path = "fuzz_targets/picture_from_reader.rs"
[[bin]]
name = "picture_from_apic_bytes"
path = "fuzz_targets/picture_from_apic_bytes.rs"
[[bin]]
name = "picture_from_flac_bytes"
path = "fuzz_targets/picture_from_flac_bytes.rs"
[[bin]]
name = "picture_from_ape_bytes"
path = "fuzz_targets/picture_from_ape_bytes.rs"

View file

@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_ape_bytes("Cover Art (Front)", data);
});

View file

@ -0,0 +1,7 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use lofty::id3::v2::Id3v2Version;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_apic_bytes(data, Id3v2Version::V4);
});

View file

@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_flac_bytes(data);
});

View file

@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_reader(&mut &*data);
});

View file

@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::PictureInformation::from_jpeg(data);
});

View file

@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::PictureInformation::from_png(data);
});