1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-05-19 16:58:04 +00:00

Read partial file that contains complete header

This commit is contained in:
Byungwan Jun 2023-08-02 18:03:10 +09:00
parent 18f1718b70
commit 0dbc481f1b

View file

@ -32,9 +32,7 @@ impl<R: Read + Seek> Mp4Reader<R> {
let header = BoxHeader::read(&mut reader)?;
let BoxHeader { name, size: s } = header;
if s > size {
return Err(Error::InvalidData(
"file contains a box with a larger size than it",
));
break;
}
// Break if size zero BoxHeader, which can result in dead-loop.