This work implements Harden spatial-media MP4 box parsing
Diff Delta:
0
Classified as:
General
ljharb's Description of Work #1911 Harden spatial-media MP4 box parsing
All translation updates must go through transifex.com.
Pull requests for those will be rejected.
Crafted MP4/MOV atoms could cause invalid Container casts, mismatched array deallocation, or copying unread heap memory to output. This hardens parsing and metadata injection against malformed box sizes and types.
-
Box ownership and copying
- Use
delete[]for array-backed box contents. - Write only bytes successfully read from input.
- Use
-
Bounds validation
- Retain 64-bit extended box sizes through validation.
- Use subtraction-based bounds checks and reject undersized headers/padding.
-
Container safety
- Require
constants::Containerbefore traversing or modifying container contents.
- Require
if (iPos > iEnd || iSize < iHeaderSize
|| iSize > static_cast<uint64_t>(iEnd - iPos))
return NULL;
- Fixes #1911
5 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Review complete πͺ
Like the credits, but with fewer stunts.