mirror of
https://github.com/alfg/mp4-rust.git
synced 2024-12-22 12:06:33 +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 header = BoxHeader::read(&mut reader)?;
|
||||||
let BoxHeader { name, size: s } = header;
|
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 and parse the atom boxes.
|
||||||
match name {
|
match name {
|
||||||
BoxType::FtypBox => {
|
BoxType::FtypBox => {
|
||||||
|
|
Loading…
Reference in a new issue