From ff9e75922b4b3b539ab088be4dc2db922c0a2c9f Mon Sep 17 00:00:00 2001 From: Stuart Woodbury Date: Wed, 5 Jul 2023 10:02:42 -0400 Subject: [PATCH] fix(reader): return Err instead of panic --- src/reader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reader.rs b/src/reader.rs index 5a39eeb..45c64b1 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -116,8 +116,8 @@ impl Mp4Reader { Ok(Mp4Reader { reader, - ftyp: ftyp.unwrap(), - moov: moov.unwrap(), + ftyp: ftyp.ok_or(crate::error::Error::BoxNotFound(BoxType::FtypBox))?, + moov: moov.ok_or(crate::error::Error::BoxNotFound(BoxType::MoovBox))?, moofs, emsgs, size,