Dominik Schmidt created TIKA-5051:
-------------------------------------

             Summary: MP4 metadata is lost when a box larger than 2 GB comes 
before moov
                 Key: TIKA-5051
                 URL: https://issues.apache.org/jira/browse/TIKA-5051
             Project: Tika
          Issue Type: Bug
          Components: parser
            Reporter: Dominik Schmidt


{{TikaMp4Reader}} stops the box walk with "Box size too large." as soon as any 
box declares more than {{Integer.MAX_VALUE}} bytes, before it decides whether 
the box is read or only skipped.

Boxes Tika does not read, like {{mdat}}, are skipped by a stream advance and 
never allocated, so their size does not matter. But a file with an {{mdat}} 
over 2 GB in front of {{moov}} (common for camera recordings, which write 
{{moov}} at the end) loses all metadata after it: no duration, dimensions, 
dates, location or track data.

The size check only needs to apply to boxes Tika actually reads into memory. 
Those are already capped by {{maxBoxSize}} (100 MB by default).

metadata-extractor's {{Mp4Reader}}, which {{TikaMp4Reader}} was copied from 
(TIKA-4812), has the same check.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to