Skip to content

Commit aea857c

Browse files
committed
Tests/Fuzz: Fix arguments to Picture::from_flac_bytes
1 parent 9ae927c commit aea857c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#![no_main]
2+
use lofty::ParsingMode;
3+
24
use libfuzzer_sys::fuzz_target;
35

46
fuzz_target!(|data: &[u8]| {
5-
let _ = lofty::Picture::from_flac_bytes(data, true);
6-
let _ = lofty::Picture::from_flac_bytes(data, false);
7-
});
7+
let _ = lofty::Picture::from_flac_bytes(data, true, ParsingMode::Relaxed);
8+
let _ = lofty::Picture::from_flac_bytes(data, false, ParsingMode::Relaxed);
9+
});

tests/picture/format_parsers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use lofty::id3::v2::{AttachedPictureFrame, Id3v2Version};
2-
use lofty::{Picture, PictureInformation, PictureType, TextEncoding};
2+
use lofty::{ParsingMode, Picture, PictureInformation, PictureType, TextEncoding};
33

44
use std::fs::File;
55
use std::io::Read;
@@ -96,7 +96,7 @@ fn as_ape_bytes() {
9696
fn flac_metadata_block_picture() {
9797
let buf = get_buf("tests/picture/assets/png_640x628.vorbis");
9898

99-
let (pic, _) = Picture::from_flac_bytes(&buf, true).unwrap();
99+
let (pic, _) = Picture::from_flac_bytes(&buf, true, ParsingMode::Strict).unwrap();
100100

101101
assert_eq!(create_original_picture(), pic);
102102
}

0 commit comments

Comments
 (0)