1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2025-01-03 08:58:40 +00:00

Relax error on box size mismatch

This commit is contained in:
Andrey Tkachenko 2023-10-19 15:40:29 +04:00
parent 35560e94f5
commit 8f10458d56

View file

@ -33,9 +33,7 @@ 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;
if s > size { if s > size {
return Err(Error::InvalidData( break;
"file contains a box with a larger size than it",
));
} }
// Break if size zero BoxHeader, which can result in dead-loop. // Break if size zero BoxHeader, which can result in dead-loop.