mirror of
https://github.com/alfg/mp4-rust.git
synced 2024-12-21 19:46:27 +00:00
bugfix: break reader loop if BoxHeader is size zero to prevent dead-loop. (#65)
This commit is contained in:
parent
7be2ebe49d
commit
e7f5f71ae3
1 changed files with 5 additions and 0 deletions
|
@ -32,6 +32,11 @@ impl<R: Read + Seek> Mp4Reader<R> {
|
|||
let header = BoxHeader::read(&mut reader)?;
|
||||
let BoxHeader { name, size: s } = header;
|
||||
|
||||
// Break if size zero BoxHeader, which can result in dead-loop.
|
||||
if s == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
// Match and parse the atom boxes.
|
||||
match name {
|
||||
BoxType::FtypBox => {
|
||||
|
|
Loading…
Reference in a new issue