From 566c023baa68d3ea9f8a377c3ae040a1b8d189ed Mon Sep 17 00:00:00 2001 From: Kubo Ryosuke Date: Fri, 3 Mar 2023 16:19:18 +0900 Subject: [PATCH] Fix for QuickTime --- read.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/read.go b/read.go index fa69561..e4fadb1 100644 --- a/read.go +++ b/read.go @@ -148,7 +148,7 @@ func readBoxStructureFromInternal(r io.ReadSeeker, bi *BoxInfo, path BoxPath, ha func readBoxStructure(r io.ReadSeeker, totalSize uint64, isRoot bool, path BoxPath, ctx Context, handler ReadHandler, params []interface{}) ([]interface{}, error) { vals := make([]interface{}, 0, 8) - for isRoot || totalSize != 0 { + for isRoot || totalSize >= SmallHeaderSize { bi, err := ReadBoxInfo(r) if isRoot && err == io.EOF { return vals, nil @@ -174,7 +174,7 @@ func readBoxStructure(r io.ReadSeeker, totalSize uint64, isRoot bool, path BoxPa } } - if totalSize != 0 { + if totalSize != 0 && !ctx.IsQuickTimeCompatible { return nil, errors.New("Unexpected EOF") }