mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2014] [MERGED] fix: Skip moov box if buffer too small to verify mvhd #2816
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/2014
Author: @cfsmp3
Created: 1/10/2026
Status: ✅ Merged
Merged: 1/11/2026
Merged by: @cfsmp3
Base:
master← Head:fix/mp4-moov-mvhd-bounds-check📝 Commits (1)
3bde3dcfix: Skip moov box if buffer too small to verify mvhd📊 Changes
1 file changed (+12 additions, -8 deletions)
View changed files
📝
src/rust/src/demuxer/stream_functions.rs(+12 -8)📄 Description
Summary
Follow-up to #1996. Fixes incorrect behavior where a "moov" box was accepted without verifying it contains "mvhd" when the buffer was too small.
The Problem
PR #1996 fixed a panic but introduced a logic error:
With the #1996 fix, if
position + 15 >= buffer.len():The Fix
Now:
Why This Is Safe
This code runs in
detect_stream_type- a one-shot format probe that reads up to 1MB. For format detection:🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.