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

Eyevinn / mp4ff / 41706269348
84%
master: 85%

Build:
Build:
LAST BUILD BRANCH: fix/crop-tables
DEFAULT BRANCH: master
Ran 03 Nov 2026 07:46PM UTC
Jobs 1
Files 237
Run time 1min
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

03 Nov 2026 07:45PM UTC coverage: 84.221% (-0.2%) from 84.418%
41706269348

Pull #698

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)
Pull Request #698: fix(mp4): limit box nesting to 64 levels, and decode nested boxes once

109 of 118 new or added lines in 19 files covered. (92.37%)

74 existing lines in 8 files now uncovered.

26970 of 32023 relevant lines covered (84.22%)

0.84 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
91.74
-0.84% mp4/audiosamplentry.go
2
94.62
-0.46% mp4/box.go
2
85.06
-0.14% mp4/container.go
1
95.72
0.54% mp4/boxsr.go

Coverage Regressions

Lines Coverage ∆ File
29
84.46
-7.27% mp4/trun.go
20
76.86
-3.86% mp4/wvtt.go
7
83.18
-2.14% mp4/vexu.go
6
77.87
-4.92% mp4/tfra.go
4
72.34
-8.51% mp4/schi.go
4
80.95
-6.35% mp4/stco.go
2
82.42
-2.2% mp4/saio.go
2
89.74
-2.56% mp4/stss.go
Jobs
ID Job ID Ran Files Coverage
1 41706269348.1 03 Nov 2026 07:46PM UTC 237
84.22
GitHub Action Run
Source Files on build 41706269348
  • Tree
  • List 237
  • Changed 18
  • Source Changed 0
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #698
  • PR Base - master (#41678061158)
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