Fuzz: Make all targets build again

None of the fuzz targets have been touched in awhile, so they haven't been compiling for most of the year probably.
This commit is contained in:
Serial 2024-08-30 23:44:56 -04:00 committed by Alex
parent d69f1cc2f3
commit 103387fa26
20 changed files with 37 additions and 25 deletions

View file

@ -12,7 +12,7 @@ cargo-fuzz = true
libfuzzer-sys = "0.4"
[dependencies.lofty]
path = ".."
path = "../lofty"
# Prevent this from interfering with workspaces
[workspace]

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::aac::AacFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::iff::aiff::AiffFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::ape::ApeFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -2,5 +2,5 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::FileType::from_buffer(data);
let _ = lofty::file::FileType::from_buffer(data);
});

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::flac::FlacFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::mp4::Mp4File::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::musepack::MpcFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::mpeg::MpegFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::ogg::OpusFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -2,5 +2,5 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_ape_bytes("Cover Art (Front)", data);
});
let _ = lofty::picture::Picture::from_ape_bytes("Cover Art (Front)", data);
});

View file

@ -1,9 +1,9 @@
#![no_main]
use lofty::ParsingMode;
use libfuzzer_sys::fuzz_target;
use lofty::config::ParsingMode;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_flac_bytes(data, true, ParsingMode::Relaxed);
let _ = lofty::Picture::from_flac_bytes(data, false, ParsingMode::Relaxed);
let _ = lofty::picture::Picture::from_flac_bytes(data, true, ParsingMode::Relaxed);
let _ = lofty::picture::Picture::from_flac_bytes(data, false, ParsingMode::Relaxed);
});

View file

@ -2,5 +2,5 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::Picture::from_reader(&mut &*data);
});
let _ = lofty::picture::Picture::from_reader(&mut &*data);
});

View file

@ -2,5 +2,5 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::PictureInformation::from_jpeg(data);
});
let _ = lofty::picture::PictureInformation::from_jpeg(data);
});

View file

@ -2,5 +2,5 @@
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::PictureInformation::from_png(data);
let _ = lofty::picture::PictureInformation::from_png(data);
});

View file

@ -3,7 +3,7 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::Probe;
use lofty::probe::Probe;
fuzz_target!(|data: Vec<u8>| {
if let Ok(probe) = Probe::new(&mut Cursor::new(data)).guess_file_type() {

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::ogg::SpeexFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::ogg::VorbisFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::iff::wav::WavFile::read_from(&mut Cursor::new(data), ParseOptions::new());

View file

@ -3,7 +3,8 @@
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::{AudioFile, ParseOptions};
use lofty::config::ParseOptions;
use lofty::file::AudioFile;
fuzz_target!(|data: Vec<u8>| {
let _ = lofty::wavpack::WavPackFile::read_from(&mut Cursor::new(data), ParseOptions::new());