Skip to content

Commit

Permalink
mp4: Match on all parse modes
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Oct 16, 2023
1 parent c5200cf commit 631ae15
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/mp4/atom_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,15 @@ impl AtomInfo {
// Seek to the end, since we can't recover from this
data.seek(SeekFrom::End(0))?;

if parse_mode == ParsingMode::Strict {
err!(BadAtom("Encountered an atom with invalid characters"));
match parse_mode {
ParsingMode::Strict => {
err!(BadAtom("Encountered an atom with invalid characters"));
},
ParsingMode::BestAttempt | ParsingMode::Relaxed => {
log::warn!("Encountered an atom with invalid characters, stopping");
return Ok(None);
},
}

log::warn!("Encountered an atom with invalid characters, stopping");
return Ok(None);
}

let (len, extended) = match len_raw {
Expand Down

0 comments on commit 631ae15

Please sign in to comment.