mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-12 13:42:34 +00:00
musepack: Add fuzz and bench targets
This commit is contained in:
parent
62190b8f9f
commit
b2a604eb3d
3 changed files with 15 additions and 0 deletions
|
@ -36,6 +36,7 @@ fn content_infer_read(c: &mut Criterion) {
|
|||
(FLAC, "../tests/files/assets/minimal/full_test.flac"),
|
||||
(MP4, "../tests/files/assets/minimal/m4a_codec_aac.m4a"),
|
||||
(MP3, "../tests/files/assets/minimal/full_test.mp3"),
|
||||
(MPC, "../tests/files/assets/minimal/mpc_sv8.mpc"),
|
||||
(OPUS, "../tests/files/assets/minimal/full_test.opus"),
|
||||
(RIFF, "../tests/files/assets/minimal/wav_format_pcm.wav"),
|
||||
(SPEEX, "../tests/files/assets/minimal/full_test.spx"),
|
||||
|
|
|
@ -22,6 +22,10 @@ members = ["."]
|
|||
name = "filetype_from_buffer"
|
||||
path = "fuzz_targets/filetype_from_buffer.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "mpcfile_read_from"
|
||||
path = "fuzz_targets/mpcfile_read_from.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "mpegfile_read_from"
|
||||
path = "fuzz_targets/mpegfile_read_from.rs"
|
||||
|
|
10
fuzz/fuzz_targets/mpcfile_read_from.rs
Normal file
10
fuzz/fuzz_targets/mpcfile_read_from.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
use std::io::Cursor;
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use lofty::{AudioFile, ParseOptions};
|
||||
|
||||
fuzz_target!(|data: Vec<u8>| {
|
||||
let _ = lofty::musepack::MpcFile::read_from(&mut Cursor::new(data), ParseOptions::new());
|
||||
});
|
Loading…
Reference in a new issue