Skip to content

Support EBML (Matroska, WebM) files #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 70 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
171bc61
EBML: Stub implement `EbmlFile` and `EbmlTag`
Serial-ATA Jun 7, 2023
7d269fe
Tests: Add a matroska test asset
Serial-ATA Jun 8, 2023
8fb8bd7
EBML: Fix warnings
Serial-ATA Jul 4, 2023
cf19e66
EBML: Support parsing VINTs
Serial-ATA Aug 5, 2023
e32f9ad
Clippy
Serial-ATA Aug 5, 2023
dabb368
Tests: Add files from official Matroska test suite
Serial-ATA Aug 6, 2023
6b2d64f
EBML: Implement reader/Parse the header for properties
Serial-ATA Sep 5, 2023
dc6b5cc
Clippy: Ignore some new lints
Serial-ATA Sep 5, 2023
6cc8f8b
lofty_attr: Add proc macro to define EBML master elements
Serial-ATA Nov 23, 2023
780184b
EBML: Make use of `max_id_length` when reading
Serial-ATA Nov 24, 2023
d24d2b1
EBML: Properly parse element ID VInts
Serial-ATA Nov 25, 2023
1bda3f3
EBML: Specify more master elements
Serial-ATA Nov 25, 2023
64526fa
EBML: Support locking the `ElementReader` to the current master
Serial-ATA Nov 25, 2023
6ea9142
EBML: Stub implement Segment parsing
Serial-ATA Nov 25, 2023
1e1c1ee
EBML: Implement integer parsing
Serial-ATA Nov 25, 2023
c159db4
EBML: Implement string parsing
Serial-ATA Nov 25, 2023
ce0488e
EBML: Fix reading outside of EBML header
Serial-ATA Nov 25, 2023
6fa3aa5
EBML: Store previous master element's size
Serial-ATA Nov 26, 2023
ed358b2
EBML: Start parsing segment.Info
Serial-ATA Nov 26, 2023
ee7f61c
EBML: Parse segment.Info.TimecodeScale
Serial-ATA Nov 26, 2023
da5d59b
EBML: Finish parsing segment.Info
Serial-ATA Nov 26, 2023
a5cc2c2
EBML: Add missing derive
Serial-ATA Nov 28, 2023
ddf0558
EBML: Specify most properties we'll end up reading
Serial-ATA Nov 28, 2023
f06c37f
EBML: Stop requiring explicit locking of reader
Serial-ATA Nov 28, 2023
fe544b6
EBML: Stub implement Segment.Tracks
Serial-ATA Nov 28, 2023
33f1123
EBML: Bring branch up to date
Serial-ATA Jul 29, 2024
b245fc7
Tests: Move matroska test files
Serial-ATA Jul 29, 2024
46338e3
EBML: Stub implement remaining Segment elements
Serial-ATA Jul 29, 2024
d97850d
EBML: Start parsing \Ebml\Segments\Tracks
Serial-ATA Jul 29, 2024
4148b64
EBML: Try to document the `ebml_master_elements` macro
Serial-ATA Jul 29, 2024
4df4d7e
EBML: Derive Default for VInt
Serial-ATA Aug 10, 2024
211a869
EBML: Define more master elements
Serial-ATA Aug 10, 2024
942512e
EBML: Improve ElementReader locking
Serial-ATA Aug 10, 2024
15a3bea
EBML: Restrict parser to certain DocTypes
Serial-ATA Aug 12, 2024
fc3a5cd
EBML: Retain all audio tracks
Serial-ATA Aug 24, 2024
3701bb1
EBML: Add basic matroska integration tests (not yet working)
Serial-ATA Aug 24, 2024
1aad2f4
EBML: Start parsing \Ebml\Segment\Attachments
Serial-ATA Aug 31, 2024
5729dde
Fuzz: Add `EbmlFile` fuzz target
Serial-ATA Aug 31, 2024
aaf8ef3
EBML: Support locking at multiple depths
Serial-ATA Aug 31, 2024
9919738
Tests: Convert EBML tests to `test_log`
Serial-ATA Sep 1, 2024
b173e5f
EBML: Start parsing \Ebml\Segment\Tags\Tag\Targets
Serial-ATA Sep 2, 2024
324c470
EBML: Start parsing \Ebml\Segment\Tags\Tag\SimpleTag
Serial-ATA Sep 9, 2024
06aafc3
EBML: Improve `ElementReader` tree navigation
Serial-ATA Sep 15, 2024
b426242
EBML: Finish parsing \Segment\Tags
Serial-ATA Sep 15, 2024
12f2c31
EBML: Impl some TagExt methods
Serial-ATA Sep 16, 2024
c7ec6ea
EBML: Make `SimpleTag` creation easier
Serial-ATA Sep 16, 2024
e275f1f
EBML: Start defining structure for writes
Serial-ATA Sep 17, 2024
1fd580f
EBML: Handle `EbmlTag` -> `Tag` conversion
Serial-ATA Oct 13, 2024
272a29c
EBML: Make `TagName` enum non-exhaustive
Serial-ATA Oct 13, 2024
05fbd34
EBML: Add properties test
Serial-ATA Oct 13, 2024
bf234cd
EBML: Define more tag mappings
Serial-ATA Oct 13, 2024
bd3db86
EBML: Get MKA properties test passing
Serial-ATA Oct 14, 2024
385176f
EBML: Rename `TagType::Ebml` -> `TagType::Matroska`
Serial-ATA Oct 14, 2024
232c20d
EBML: Add mapping for `ItemKey::TrackSubtitle`
Serial-ATA Oct 14, 2024
5a531d7
EBML: Support duration and bitrate calculation
Serial-ATA Oct 15, 2024
4724cfd
Tests: Enable property reading for `*::read` tests
Serial-ATA Oct 15, 2024
ba6f390
misc: Clippy
Serial-ATA Oct 15, 2024
5bad295
EBML: Retain companion tag
Serial-ATA Oct 15, 2024
05e3e9f
misc: fmt
Serial-ATA Oct 15, 2024
f37501b
EBML: Stub MergeTag impl
Serial-ATA Oct 15, 2024
494aabd
EBML: Add generic tag conversion test
Serial-ATA Oct 19, 2024
7b25039
EBML: Writing WIP
Serial-ATA Oct 28, 2024
4e44bc4
EBML: add generic conversion to `MatroskaTagRef`
Serial-ATA Nov 2, 2024
ea6999b
misc: Clippy + rustdoc
Serial-ATA Nov 23, 2024
2f70f21
EBML: Add saturating_sub back to VInt
Serial-ATA Jan 5, 2025
330a88e
EBML: Bring branch up to date
Serial-ATA Jul 8, 2025
a164768
EBML: Basic MatroskaTag manipulation
Serial-ATA Jul 8, 2025
21218f4
EBML: Write support for \Segment children
Serial-ATA Jul 8, 2025
d5dcbaa
EBML: Add more generic tag mappings
Serial-ATA Jul 8, 2025
31c41ad
EBML: Bring branch up to date
Serial-ATA Jul 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ path = "fuzz_targets/apefile_read_from.rs"
test = false
doc = false

[[bin]]
name = "ebmlfile_read_from"
path = "fuzz_targets/ebmlfile_read_from.rs"

[[bin]]
name = "flacfile_read_from"
path = "fuzz_targets/flacfile_read_from.rs"
Expand Down
11 changes: 11 additions & 0 deletions fuzz/fuzz_targets/ebmlfile_read_from.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_main]

use std::io::Cursor;

use libfuzzer_sys::fuzz_target;
use lofty::config::ParseOptions;
use lofty::file::AudioFile;

fuzz_target!(|data: Vec<u8>| {
let _ = lofty::ebml::EbmlFile::read_from(&mut Cursor::new(data), ParseOptions::new());
});
1 change: 1 addition & 0 deletions lofty/src/ape/tag/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ mod tests {
fn skip_reading_cover_art() {
let p = Picture::new_unchecked(
PictureType::CoverFront,
None,
Some(MimeType::Jpeg),
None,
std::iter::repeat(0).take(50).collect::<Vec<u8>>(),
Expand Down
Loading
Loading