From 8f10458d56d95c8366a97df2d50f306c2a50d87c Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Thu, 19 Oct 2023 15:40:29 +0400 Subject: [PATCH] Relax error on box size mismatch --- src/reader.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/reader.rs b/src/reader.rs index e5ac296..6864e93 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -33,9 +33,7 @@ impl Mp4Reader { 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.