• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Eyevinn / mp4ff / 41797779214 / 1
85%
master: 85%

Build:
DEFAULT BRANCH: master
Ran 04 Nov 2026 08:13AM UTC
Files 237
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Nov 2026 08:12AM UTC coverage: 84.221% (-0.2%) from 84.418%
41797779214.1

push

github

tobbee
fix(mp4): limit box nesting to 64 levels

A million nested boxes (8 MB) overflowed the stack, a fatal error that recover cannot catch, and deep nesting made decoding quadratic, since each container computes its size from its whole subtree after each child: 40,000 nested moov boxes (312 KB) took 5.3 s in DecodeFileSR.

Decoding now stops at the new mp4.MaxBoxDepth, 64, with the new mp4.ErrBoxTooDeep. Among 277 local files from the FFmpeg FATE suite and the mp4ff test data, the deepest nest 11 boxes, such as moov/trak/mdia/minf/stbl/stsd/hvc1/vexu/eyes/cams/blin. FFmpeg's mov demuxer stops at 10 nested containers.

The depth is kept on the bits.FixedSliceReader that the boxes are decoded from, with the new Depth and SetDepth, and checked in decodeBoxBodySR, which all decoding from a slice reader goes through. BoxHeader stays at 32 bytes and the decoders get no new parameter. FixedSliceReader grows from 56 to 64 bytes, the same allocation size class.

- decodeContainerChildren reads the payload of a container decoded from an io.Reader and decodes the children from it, as DecodeMoov and DecodeMoof already did, so all boxes below it are decoded on one counted reader. The io.Reader decoders of the other boxes with children start their reader at depth 1 (ioPayloadReader).
- The decoders that open a reader of their own for children, those of wave, ilst items, audio sample entries and decodeOrUnknownSR, continue the depth of their parent.
- boxtree, which walks the boxes itself after a decode error, stops at the same depth.
- ErrBoxTooDeep is returned as made for the box that is too deep, without the decode prefix of each box above it.
- A bits.SliceReader other than bits.FixedSliceReader is not counted.

A child that overruns a container decoded from an io.Reader now gets the error of the slice reader path, that the child is too big, which TestNonMatchingChildSizesErrorIsBounded accepts.

TestBoxDepthLimit decodes 64 nested levels and gets ErrBoxTooDeep at 65... (continued)

26970 of 32023 relevant lines covered (84.22%)

0.84 hits per line

Source Files on job 41797779214.1
  • Tree
  • List 237
  • Changed 18
  • Source Changed 0
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41797779214
  • ac2d403f on github
  • Prev Job for on master (#41678061158.1)
  • Next Job for on master (#41800347956.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc