mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2025-03-04 23:07:20 +00:00
MP4: Use late init in AtomInfo::read
This commit is contained in:
parent
f0953a6e78
commit
adc3b0ac9c
1 changed files with 6 additions and 4 deletions
|
@ -183,16 +183,18 @@ impl AtomInfo {
|
|||
err!(SizeMismatch);
|
||||
}
|
||||
|
||||
let atom_ident = if identifier == *b"----" {
|
||||
let atom_ident;
|
||||
if identifier == *b"----" {
|
||||
// Encountered a freeform identifier
|
||||
reader_size -= ATOM_HEADER_LEN;
|
||||
if reader_size < ATOM_HEADER_LEN {
|
||||
err!(BadAtom("Found an incomplete freeform identifier"));
|
||||
}
|
||||
parse_freeform(data, reader_size, parse_mode)?
|
||||
|
||||
atom_ident = parse_freeform(data, reader_size, parse_mode)?;
|
||||
} else {
|
||||
AtomIdent::Fourcc(identifier)
|
||||
};
|
||||
atom_ident = AtomIdent::Fourcc(identifier);
|
||||
}
|
||||
|
||||
Ok(Some(Self {
|
||||
start,
|
||||
|
|
Loading…
Add table
Reference in a new issue