avformat/mov: bound infe entries by the iinf size #25006
No reviewers
Labels
No labels
avcodec
avdevice
avfilter
avformat
avutil
backport/release/4.3
backport/release/4.4
backport/release/5.0
backport/release/5.1
backport/release/6.0
backport/release/6.1
backport/release/7.0
backport/release/7.1
backport/release/8.0
backport/release/8.1
backport/release/9.0
backport/release/9.1
CLI
doc
Forgejo Fairy
swresample
swscale
vulkan
API
API major
bug
enhancement
fix/bug
fix/regression
GSoC
GSoC-Qualification
help wanted
important
LGTM
meta
needs backport
needs docs
needs fate test
needs info
needs sample
needs testing
new
question
regression
repro
flaky
repro
no
repro
no(env)
repro
yes
resolution
duplicate
resolution
external
resolution
fixed
resolution
invalid
resolution
wontfix
security
small
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
FFmpeg/FFmpeg!25006
Loading…
Reference in a new issue
No description provided.
Delete branch "prasanna8585/FFmpeg:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mov_read_iinf() reads each infe sub-box's declared size directly off the bitstream with no check against how much of the enclosing iinf box is actually left, unlike mov_read_iprp() which already bounds its ipco/ipma entries against the remaining iprp size (
e3f5f17,466ea98).Track the same kind of running size budget here: subtract the version/flags/entry_count header from atom.size up front, then validate each infe_size against what is actually left before trusting it, mirroring e3f5f17's pattern exactly.
No memory-safety issue is known to depend on this; avio already bounds reads to the real file length. This is defense-in-depth, closing the same class of gap the sibling commits above just closed one box over.
Signed-off-by: Prasanna Dabi [email protected]
Summary of changes
Briefly describe what this PR does and why. Bounds each
infeentry's declared size against what's actually left in the enclosingiinfbox, mirroring the same hardening pattern just applied toipco/ipmain e3f5f17/466ea98. No crash is known to depend on this — it's defense-in-depth for the same bug class.6d7ab3ebfbf2051b38c8Changed it a bit (added an extra check for the box type) and applied it. Thanks.