diff --git a/CHANGELOG.md b/CHANGELOG.md index 2158d069..6a14a7b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - **TaggedFile**: `tag{_mut}` no longer takes a reference to `TagType` - **ID3v2**: `LanguageFrame`'s `lang` field has changed type - `String` -> `[u8; 3]` +- **MP3**: Renamed `MP3File` -> `MPEGFile` ## [0.7.3] - 2022-07-22 diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index a36df44d..4827aa9f 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -24,7 +24,7 @@ path = "fuzz_targets/filetype_from_buffer.rs" [[bin]] name = "mp3file_read_from" -path = "fuzz_targets/mp3file_read_from.rs" +path = "fuzz_targets/mpegfile_read_from.rs" [[bin]] name = "aifffile_read_from" diff --git a/fuzz/fuzz_targets/mp3file_read_from.rs b/fuzz/fuzz_targets/mpegfile_read_from.rs similarity index 62% rename from fuzz/fuzz_targets/mp3file_read_from.rs rename to fuzz/fuzz_targets/mpegfile_read_from.rs index 56637b8a..c3441a4a 100644 --- a/fuzz/fuzz_targets/mp3file_read_from.rs +++ b/fuzz/fuzz_targets/mpegfile_read_from.rs @@ -2,9 +2,9 @@ use std::io::Cursor; -use lofty::AudioFile; use libfuzzer_sys::fuzz_target; +use lofty::AudioFile; fuzz_target!(|data: Vec| { - let _ = lofty::mp3::Mp3File::read_from(&mut Cursor::new(data), false); + let _ = lofty::mp3::MPEGFile::read_from(&mut Cursor::new(data), false); }); diff --git a/lofty_attr/src/lib.rs b/lofty_attr/src/lib.rs index 5a5f09e4..52a0f726 100644 --- a/lofty_attr/src/lib.rs +++ b/lofty_attr/src/lib.rs @@ -9,7 +9,7 @@ use syn::{ }; const LOFTY_FILE_TYPES: [&str; 10] = [ - "AIFF", "APE", "FLAC", "MP3", "MP4", "Opus", "Vorbis", "Speex", "WAV", "WavPack", + "AIFF", "APE", "FLAC", "MPEG", "MP4", "Opus", "Vorbis", "Speex", "WAV", "WavPack", ]; #[proc_macro_derive(LoftyFile, attributes(lofty))] diff --git a/src/ape/tag/mod.rs b/src/ape/tag/mod.rs index bfc40467..9d11625b 100644 --- a/src/ape/tag/mod.rs +++ b/src/ape/tag/mod.rs @@ -53,7 +53,7 @@ macro_rules! impl_accessor { /// ## Supported file types /// /// * [`FileType::APE`](crate::FileType::APE) -/// * [`FileType::MP3`](crate::FileType::MP3) +/// * [`FileType::MP3`](crate::FileType::MPEG) /// * [`FileType::WavPack`](crate::FileType::WavPack) /// /// ## Item storage diff --git a/src/ape/tag/write.rs b/src/ape/tag/write.rs index c7aa40cc..76b5a311 100644 --- a/src/ape/tag/write.rs +++ b/src/ape/tag/write.rs @@ -23,7 +23,7 @@ where let probe = Probe::new(data).guess_file_type()?; match probe.file_type() { - Some(FileType::APE | FileType::MP3 | FileType::WavPack) => {}, + Some(FileType::APE | FileType::MPEG | FileType::WavPack) => {}, _ => err!(UnsupportedTag), } diff --git a/src/file.rs b/src/file.rs index 5cce8922..bcc4e712 100644 --- a/src/file.rs +++ b/src/file.rs @@ -68,7 +68,7 @@ impl TaggedFile { /// # let path_to_mp3 = "tests/files/assets/minimal/full_test.mp3"; /// let mut tagged_file = lofty::read_from_path(path_to_mp3, true)?; /// - /// assert_eq!(tagged_file.file_type(), FileType::MP3); + /// assert_eq!(tagged_file.file_type(), FileType::MPEG); /// # Ok(()) } /// ``` pub fn file_type(&self) -> FileType { @@ -483,7 +483,7 @@ pub enum FileType { AIFF, APE, FLAC, - MP3, + MPEG, MP4, Opus, Vorbis, @@ -513,7 +513,7 @@ impl FileType { /// ```rust /// use lofty::{FileType, TagType}; /// - /// let file_type = FileType::MP3; + /// let file_type = FileType::MPEG; /// assert_eq!(file_type.primary_tag_type(), TagType::ID3v2); /// ``` pub fn primary_tag_type(&self) -> TagType { @@ -523,12 +523,12 @@ impl FileType { #[cfg(all(not(feature = "id3v2"), feature = "riff_info_list"))] FileType::WAV => TagType::RIFFInfo, #[cfg(all(not(feature = "id3v2"), feature = "id3v1"))] - FileType::MP3 => TagType::ID3v1, + FileType::MPEG => TagType::ID3v1, #[cfg(all(not(feature = "id3v2"), not(feature = "id3v1"), feature = "ape"))] - FileType::MP3 => TagType::APE, - FileType::AIFF | FileType::MP3 | FileType::WAV => TagType::ID3v2, + FileType::MPEG => TagType::APE, + FileType::AIFF | FileType::MPEG | FileType::WAV => TagType::ID3v2, #[cfg(all(not(feature = "ape"), feature = "id3v1"))] - FileType::MP3 | FileType::WavPack => TagType::ID3v1, + FileType::MPEG | FileType::WavPack => TagType::ID3v1, FileType::APE | FileType::WavPack => TagType::APE, FileType::FLAC | FileType::Opus | FileType::Vorbis | FileType::Speex => { TagType::VorbisComments @@ -558,13 +558,13 @@ impl FileType { /// ```rust /// use lofty::{FileType, TagType}; /// - /// let file_type = FileType::MP3; + /// let file_type = FileType::MPEG; /// assert!(file_type.supports_tag_type(TagType::ID3v2)); /// ``` pub fn supports_tag_type(&self, tag_type: TagType) -> bool { match self { #[cfg(feature = "id3v2")] - FileType::AIFF | FileType::APE | FileType::MP3 | FileType::WAV + FileType::AIFF | FileType::APE | FileType::MPEG | FileType::WAV if tag_type == TagType::ID3v2 => { true @@ -572,9 +572,9 @@ impl FileType { #[cfg(feature = "aiff_text_chunks")] FileType::AIFF if tag_type == TagType::AIFFText => true, #[cfg(feature = "id3v1")] - FileType::APE | FileType::MP3 | FileType::WavPack if tag_type == TagType::ID3v1 => true, + FileType::APE | FileType::MPEG | FileType::WavPack if tag_type == TagType::ID3v1 => true, #[cfg(feature = "ape")] - FileType::APE | FileType::MP3 | FileType::WavPack if tag_type == TagType::APE => true, + FileType::APE | FileType::MPEG | FileType::WavPack if tag_type == TagType::APE => true, #[cfg(feature = "vorbis_comments")] FileType::Opus | FileType::FLAC | FileType::Vorbis | FileType::Speex => { tag_type == TagType::VorbisComments @@ -605,7 +605,7 @@ impl FileType { /// use lofty::FileType; /// /// let extension = "mp3"; - /// assert_eq!(FileType::from_ext(extension), Some(FileType::MP3)); + /// assert_eq!(FileType::from_ext(extension), Some(FileType::MPEG)); /// ``` pub fn from_ext(ext: E) -> Option where @@ -616,7 +616,7 @@ impl FileType { match ext.as_str() { "ape" => Some(Self::APE), "aiff" | "aif" | "afc" | "aifc" => Some(Self::AIFF), - "mp3" | "mp2" | "mp1" => Some(Self::MP3), + "mp3" | "mp2" | "mp1" => Some(Self::MPEG), "wav" | "wave" => Some(Self::WAV), "wv" => Some(Self::WavPack), "opus" => Some(Self::Opus), @@ -648,7 +648,7 @@ impl FileType { /// use std::path::Path; /// /// let path = Path::new("path/to/my.mp3"); - /// assert_eq!(FileType::from_path(path), Some(FileType::MP3)); + /// assert_eq!(FileType::from_path(path), Some(FileType::MPEG)); /// ``` pub fn from_path

(path: P) -> Option where @@ -733,7 +733,7 @@ impl FileType { // Safe to index, since we return early on an empty buffer match buf[0] { 77 if buf.starts_with(b"MAC") => Some(Self::APE), - 255 if buf.len() >= 2 && verify_frame_sync([buf[0], buf[1]]) => Some(Self::MP3), + 255 if buf.len() >= 2 && verify_frame_sync([buf[0], buf[1]]) => Some(Self::MPEG), 70 if buf.len() >= 12 && &buf[..4] == b"FORM" => { let id = &buf[8..12]; diff --git a/src/id3/v1/tag.rs b/src/id3/v1/tag.rs index f26ffe33..8e6cb2f7 100644 --- a/src/id3/v1/tag.rs +++ b/src/id3/v1/tag.rs @@ -41,7 +41,7 @@ macro_rules! impl_accessor { /// ## Supported file types /// /// * [`FileType::APE`](crate::FileType::APE) -/// * [`FileType::MP3`](crate::FileType::MP3) +/// * [`FileType::MP3`](crate::FileType::MPEG) /// * [`FileType::WavPack`](crate::FileType::WavPack) /// /// ## Conversions diff --git a/src/id3/v1/write.rs b/src/id3/v1/write.rs index 09fa1baf..95bb7e6f 100644 --- a/src/id3/v1/write.rs +++ b/src/id3/v1/write.rs @@ -15,7 +15,7 @@ pub(crate) fn write_id3v1(writer: &mut File, tag: &Id3v1TagRef<'_>) -> Result<() let probe = Probe::new(writer).guess_file_type()?; match probe.file_type() { - Some(FileType::APE | FileType::MP3 | FileType::WavPack) => {}, + Some(FileType::APE | FileType::MPEG | FileType::WavPack) => {}, _ => err!(UnsupportedTag), } diff --git a/src/id3/v2/tag.rs b/src/id3/v2/tag.rs index 01996aca..4cffecbc 100644 --- a/src/id3/v2/tag.rs +++ b/src/id3/v2/tag.rs @@ -64,7 +64,7 @@ macro_rules! impl_accessor { /// /// ## Supported file types /// -/// * [`FileType::MP3`](crate::FileType::MP3) +/// * [`FileType::MP3`](crate::FileType::MPEG) /// * [`FileType::WAV`](crate::FileType::WAV) /// * [`FileType::AIFF`](crate::FileType::AIFF) /// * [`FileType::APE`](crate::FileType::APE) **(READ ONLY)** diff --git a/src/id3/v2/write/mod.rs b/src/id3/v2/write/mod.rs index 512d5f6d..541e0c7c 100644 --- a/src/id3/v2/write/mod.rs +++ b/src/id3/v2/write/mod.rs @@ -42,7 +42,7 @@ pub(crate) fn write_id3v2<'a, I: Iterator> + 'a>( let data = probe.into_inner(); match file_type { - Some(FileType::APE | FileType::MP3 | FileType::FLAC) => {}, + Some(FileType::APE | FileType::MPEG | FileType::FLAC) => {}, // Formats such as WAV and AIFF store the ID3v2 tag in an 'ID3 ' chunk rather than at the beginning of the file Some(FileType::WAV) => { tag.flags.footer = false; diff --git a/src/lib.rs b/src/lib.rs index 62e6d1cd..886871ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -91,7 +91,7 @@ //! ```rust //! # use lofty::LoftyError; //! # fn main() -> Result<(), LoftyError> { -//! use lofty::mp3::Mp3File; +//! use lofty::mp3::MPEGFile; //! use lofty::{AudioFile, TagType}; //! use std::fs::File; //! @@ -99,7 +99,7 @@ //! let mut file_content = File::open(path)?; //! //! // We are expecting an MP3 file -//! let mp3_file = Mp3File::read_from(&mut file_content, true)?; +//! let mp3_file = MPEGFile::read_from(&mut file_content, true)?; //! //! assert_eq!(mp3_file.properties().channels(), 2); //! diff --git a/src/mp3/header.rs b/src/mp3/header.rs index ccc64733..12b9e4ae 100644 --- a/src/mp3/header.rs +++ b/src/mp3/header.rs @@ -309,7 +309,7 @@ impl XingHeader { b"Xing" | b"Info" => { if reader_len < 16 { return Err(FileDecodingError::new( - FileType::MP3, + FileType::MPEG, "Xing header has an invalid size (< 16)", ) .into()); @@ -336,7 +336,7 @@ impl XingHeader { b"VBRI" => { if reader_len < 32 { return Err(FileDecodingError::new( - FileType::MP3, + FileType::MPEG, "VBRI header has an invalid size (< 32)", ) .into()); diff --git a/src/mp3/mod.rs b/src/mp3/mod.rs index 5b2efa80..cdc19991 100644 --- a/src/mp3/mod.rs +++ b/src/mp3/mod.rs @@ -18,10 +18,10 @@ use crate::tag::TagType; use lofty_attr::LoftyFile; -/// An MP3 file -#[derive(Default, LoftyFile)] +/// An MPEG file +#[derive(LoftyFile, Default)] #[lofty(read_fn = "read::read_from")] -pub struct Mp3File { +pub struct MPEGFile { /// An ID3v2 tag #[cfg(feature = "id3v2")] #[lofty(tag_type = "ID3v2")] diff --git a/src/mp3/read.rs b/src/mp3/read.rs index a6539928..efe70a27 100644 --- a/src/mp3/read.rs +++ b/src/mp3/read.rs @@ -1,5 +1,5 @@ use super::header::{cmp_header, search_for_frame_sync, Header, HeaderCmpResult, XingHeader}; -use super::{Mp3File, Mp3Properties}; +use super::{MPEGFile, Mp3Properties}; use crate::ape::constants::APE_PREAMBLE; use crate::ape::header::read_ape_header; #[cfg(feature = "ape")] @@ -16,11 +16,11 @@ use std::io::{Read, Seek, SeekFrom}; use byteorder::{BigEndian, ReadBytesExt}; -pub(super) fn read_from(reader: &mut R, read_properties: bool) -> Result +pub(super) fn read_from(reader: &mut R, read_properties: bool) -> Result where R: Read + Seek, { - let mut file = Mp3File::default(); + let mut file = MPEGFile::default(); let mut first_frame_offset = 0; let mut first_frame_header = None; @@ -141,7 +141,7 @@ where None => { // The search for sync bits was unsuccessful return Err(FileDecodingError::new( - FileType::MP3, + FileType::MPEG, "File contains an invalid frame", ) .into()); @@ -149,7 +149,7 @@ where }; if first_frame_header.sample_rate == 0 { - return Err(FileDecodingError::new(FileType::MP3, "Sample rate is 0").into()); + return Err(FileDecodingError::new(FileType::MPEG, "Sample rate is 0").into()); } let first_frame_offset = first_frame_offset; diff --git a/src/probe.rs b/src/probe.rs index 59998ddd..38d9c92d 100644 --- a/src/probe.rs +++ b/src/probe.rs @@ -6,7 +6,7 @@ use crate::iff::aiff::AiffFile; use crate::iff::wav::WavFile; use crate::macros::err; use crate::mp3::header::search_for_frame_sync; -use crate::mp3::Mp3File; +use crate::mp3::MPEGFile; use crate::mp4::Mp4File; use crate::ogg::opus::OpusFile; use crate::ogg::speex::SpeexFile; @@ -36,7 +36,7 @@ use std::path::Path; /// let probe = Probe::open("path/to/my.mp3")?; /// /// // Inferred from the `mp3` extension -/// assert_eq!(probe.file_type(), Some(FileType::MP3)); +/// assert_eq!(probe.file_type(), Some(FileType::MPEG)); /// # Ok(()) /// # } /// ``` @@ -52,7 +52,7 @@ use std::path::Path; /// let probe = Probe::open("path/to/my.mp3")?.guess_file_type()?; /// /// // Inferred from the file's content -/// assert_eq!(probe.file_type(), Some(FileType::MP3)); +/// assert_eq!(probe.file_type(), Some(FileType::MPEG)); /// # Ok(()) /// # } /// ``` @@ -126,7 +126,7 @@ impl Probe { /// let file = File::open(my_mp3_path)?; /// let reader = BufReader::new(file); /// - /// let probe = Probe::with_file_type(reader, FileType::MP3); + /// let probe = Probe::with_file_type(reader, FileType::MPEG); /// # Ok(()) } /// ``` pub fn with_file_type(reader: R, file_type: FileType) -> Self { @@ -166,9 +166,9 @@ impl Probe { /// let mut probe = Probe::new(reader); /// assert_eq!(probe.file_type(), None); /// - /// probe.set_file_type(FileType::MP3); + /// probe.set_file_type(FileType::MPEG); /// - /// assert_eq!(probe.file_type(), Some(FileType::MP3)); + /// assert_eq!(probe.file_type(), Some(FileType::MPEG)); /// # Ok(()) } /// ``` pub fn set_file_type(&mut self, file_type: FileType) { @@ -213,7 +213,7 @@ impl Probe> { /// let probe = Probe::open("path/to/my.mp3")?; /// /// // Guessed from the "mp3" extension, see `FileType::from_ext` - /// assert_eq!(probe.file_type(), Some(FileType::MP3)); + /// assert_eq!(probe.file_type(), Some(FileType::MPEG)); /// # Ok(()) } /// ``` pub fn open

(path: P) -> Result @@ -252,7 +252,7 @@ impl Probe { /// let probe = Probe::new(reader).guess_file_type()?; /// /// // Determined the file is MP3 from the content - /// assert_eq!(probe.file_type(), Some(FileType::MP3)); + /// assert_eq!(probe.file_type(), Some(FileType::MPEG)); /// # Ok(()) } /// ``` pub fn guess_file_type(mut self) -> std::io::Result { @@ -302,7 +302,7 @@ impl Probe { b"fLaC" => Ok(Some(FileType::FLAC)), // Search for a frame sync, which may be preceded by junk _ if search_for_frame_sync(&mut self.inner)?.is_some() => { - Ok(Some(FileType::MP3)) + Ok(Some(FileType::MPEG)) }, _ => Ok(None), }; @@ -365,7 +365,7 @@ impl Probe { FileType::AIFF => AiffFile::read_from(reader, read_properties)?.into(), FileType::APE => ApeFile::read_from(reader, read_properties)?.into(), FileType::FLAC => FlacFile::read_from(reader, read_properties)?.into(), - FileType::MP3 => Mp3File::read_from(reader, read_properties)?.into(), + FileType::MPEG => MPEGFile::read_from(reader, read_properties)?.into(), FileType::Opus => OpusFile::read_from(reader, read_properties)?.into(), FileType::Vorbis => VorbisFile::read_from(reader, read_properties)?.into(), FileType::WAV => WavFile::read_from(reader, read_properties)?.into(), @@ -473,7 +473,7 @@ mod tests { let data: Vec = data.into_iter().flatten().copied().collect(); let data = std::io::Cursor::new(&data); let probe = Probe::new(data).guess_file_type().unwrap(); - assert_eq!(probe.file_type(), Some(FileType::MP3)); + assert_eq!(probe.file_type(), Some(FileType::MPEG)); } fn test_probe(path: &str, expected_file_type_guess: FileType) { @@ -516,7 +516,7 @@ mod tests { #[test] fn probe_mp3_with_id3v2() { - test_probe("tests/files/assets/minimal/full_test.mp3", FileType::MP3); + test_probe("tests/files/assets/minimal/full_test.mp3", FileType::MPEG); } #[test] diff --git a/src/properties.rs b/src/properties.rs index 6a54fcb9..5f61ca08 100644 --- a/src/properties.rs +++ b/src/properties.rs @@ -62,7 +62,7 @@ mod tests { use crate::ape::{ApeFile, ApeProperties}; use crate::flac::FlacFile; use crate::iff::{AiffFile, WavFile, WavFormat, WavProperties}; - use crate::mp3::{ChannelMode, Emphasis, Layer, Mp3File, Mp3Properties, MpegVersion}; + use crate::mp3::{ChannelMode, Emphasis, Layer, MPEGFile, Mp3Properties, MpegVersion}; use crate::mp4::{AudioObjectType, Mp4Codec, Mp4File, Mp4Properties}; use crate::ogg::{ OpusFile, OpusProperties, SpeexFile, SpeexProperties, VorbisFile, VorbisProperties, @@ -287,7 +287,7 @@ mod tests { #[test] fn mp1_properties() { assert_eq!( - get_properties::("tests/files/assets/minimal/full_test.mp1"), + get_properties::("tests/files/assets/minimal/full_test.mp1"), MP1_PROPERTIES ) } @@ -295,7 +295,7 @@ mod tests { #[test] fn mp2_properties() { assert_eq!( - get_properties::("tests/files/assets/minimal/full_test.mp2"), + get_properties::("tests/files/assets/minimal/full_test.mp2"), MP2_PROPERTIES ) } @@ -303,7 +303,7 @@ mod tests { #[test] fn mp3_properties() { assert_eq!( - get_properties::("tests/files/assets/minimal/full_test.mp3"), + get_properties::("tests/files/assets/minimal/full_test.mp3"), MP3_PROPERTIES ) } diff --git a/src/tag/utils.rs b/src/tag/utils.rs index fb485e0e..dfc9216d 100644 --- a/src/tag/utils.rs +++ b/src/tag/utils.rs @@ -31,7 +31,7 @@ pub(crate) fn write_tag(tag: &Tag, file: &mut File, file_type: FileType) -> Resu FileType::FLAC | FileType::Opus | FileType::Speex | FileType::Vorbis => { crate::ogg::write::write_to(file, tag, file_type) }, - FileType::MP3 => mp3::write::write_to(file, tag), + FileType::MPEG => mp3::write::write_to(file, tag), #[cfg(feature = "mp4_ilst")] FileType::MP4 => { crate::mp4::ilst::write::write_to(file, &mut Into::::into(tag.clone()).as_ref()) diff --git a/tests/files/mpeg.rs b/tests/files/mpeg.rs index ebe8f64e..f3f6d178 100644 --- a/tests/files/mpeg.rs +++ b/tests/files/mpeg.rs @@ -7,7 +7,7 @@ fn read() { // Here we have an MP3 file with an ID3v2, ID3v1, and an APEv2 tag let file = lofty::read_from_path("tests/files/assets/minimal/full_test.mp3", false).unwrap(); - assert_eq!(file.file_type(), FileType::MP3); + assert_eq!(file.file_type(), FileType::MPEG); // Verify the ID3v2 tag first crate::verify_artist!(file, primary_tag, "Foo artist", 1); @@ -26,7 +26,7 @@ fn read_with_junk_bytes_between_frames() { lofty::read_from_path("tests/files/assets/junk_between_id3_and_mp3.mp3", true).unwrap(); // note that the file contains ID3v2 and ID3v1 data - assert_eq!(file.file_type(), FileType::MP3); + assert_eq!(file.file_type(), FileType::MPEG); let id3v2_tag = &file.tags()[0]; assert_eq!(id3v2_tag.artist(), Some("artist test")); @@ -49,7 +49,7 @@ fn write() { let mut tagged_file = lofty::read_from(&mut file, false).unwrap(); - assert_eq!(tagged_file.file_type(), FileType::MP3); + assert_eq!(tagged_file.file_type(), FileType::MPEG); // ID3v2 crate::set_artist!(tagged_file, primary_tag_mut, "Foo artist", 1 => file, "Bar artist"); diff --git a/tests/files/zero_sized.rs b/tests/files/zero_sized.rs index e4aef37b..b3bc31b0 100644 --- a/tests/files/zero_sized.rs +++ b/tests/files/zero_sized.rs @@ -1,7 +1,7 @@ use lofty::ape::ApeFile; use lofty::flac::FlacFile; use lofty::iff::{AiffFile, WavFile}; -use lofty::mp3::Mp3File; +use lofty::mp3::MPEGFile; use lofty::mp4::Mp4File; use lofty::AudioFile; @@ -46,9 +46,9 @@ fn zero_audio_flac() { fn zero_audio_mp3() { let path = "tests/files/assets/zero/zero.mp3"; // A zero-size MP3 will error, since we need MPEG frames to extract audio properties - assert!(!read_file_with_properties::(path)); + assert!(!read_file_with_properties::(path)); - assert!(read_file_no_properties::(path)) + assert!(read_file_no_properties::(path)) } #[test] diff --git a/tests/fuzz/assets/mp3file_read_from/oom-f8730cbfa5682ab12343ccb70de9b71a061ef4d0 b/tests/fuzz/assets/mpegfile_read_from/oom-f8730cbfa5682ab12343ccb70de9b71a061ef4d0 similarity index 100% rename from tests/fuzz/assets/mp3file_read_from/oom-f8730cbfa5682ab12343ccb70de9b71a061ef4d0 rename to tests/fuzz/assets/mpegfile_read_from/oom-f8730cbfa5682ab12343ccb70de9b71a061ef4d0 diff --git a/tests/fuzz/main.rs b/tests/fuzz/main.rs index 6c6e04ed..55065ad6 100644 --- a/tests/fuzz/main.rs +++ b/tests/fuzz/main.rs @@ -6,8 +6,8 @@ use std::time::Instant; mod aifffile_read_from; mod flacfile_read_from; -mod mp3file_read_from; mod mp4file_read_from; +mod mpegfile_read_from; mod opusfile_read_from; mod pictureinformation_from_jpeg; mod pictureinformation_from_png; diff --git a/tests/fuzz/mp3file_read_from.rs b/tests/fuzz/mp3file_read_from.rs deleted file mode 100644 index 82d45b31..00000000 --- a/tests/fuzz/mp3file_read_from.rs +++ /dev/null @@ -1,7 +0,0 @@ -use crate::oom_test; -use lofty::mp3::Mp3File; - -#[test] -fn oom1() { - oom_test::("mp3file_read_from/oom-f8730cbfa5682ab12343ccb70de9b71a061ef4d0"); -} diff --git a/tests/fuzz/mpegfile_read_from.rs b/tests/fuzz/mpegfile_read_from.rs new file mode 100644 index 00000000..69cfee62 --- /dev/null +++ b/tests/fuzz/mpegfile_read_from.rs @@ -0,0 +1,7 @@ +use crate::oom_test; +use lofty::mp3::MPEGFile; + +#[test] +fn oom1() { + oom_test::("mpegfile_read_from/oom-f8730cbfa5682ab12343ccb70de9b71a061ef4d0"); +}