diff --git a/fuzz/fuzz_targets/picture_from_flac_bytes.rs b/fuzz/fuzz_targets/picture_from_flac_bytes.rs index 97b13297..e406e885 100644 --- a/fuzz/fuzz_targets/picture_from_flac_bytes.rs +++ b/fuzz/fuzz_targets/picture_from_flac_bytes.rs @@ -1,7 +1,9 @@ #![no_main] +use lofty::ParsingMode; + use libfuzzer_sys::fuzz_target; fuzz_target!(|data: &[u8]| { - let _ = lofty::Picture::from_flac_bytes(data, true); - let _ = lofty::Picture::from_flac_bytes(data, false); -}); \ No newline at end of file + let _ = lofty::Picture::from_flac_bytes(data, true, ParsingMode::Relaxed); + let _ = lofty::Picture::from_flac_bytes(data, false, ParsingMode::Relaxed); +}); diff --git a/tests/picture/format_parsers.rs b/tests/picture/format_parsers.rs index dc19540b..b963c028 100644 --- a/tests/picture/format_parsers.rs +++ b/tests/picture/format_parsers.rs @@ -1,5 +1,5 @@ use lofty::id3::v2::{AttachedPictureFrame, Id3v2Version}; -use lofty::{Picture, PictureInformation, PictureType, TextEncoding}; +use lofty::{ParsingMode, Picture, PictureInformation, PictureType, TextEncoding}; use std::fs::File; use std::io::Read; @@ -96,7 +96,7 @@ fn as_ape_bytes() { fn flac_metadata_block_picture() { let buf = get_buf("tests/picture/assets/png_640x628.vorbis"); - let (pic, _) = Picture::from_flac_bytes(&buf, true).unwrap(); + let (pic, _) = Picture::from_flac_bytes(&buf, true, ParsingMode::Strict).unwrap(); assert_eq!(create_original_picture(), pic); }