mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
[PR #1817] [MERGED] fix(rust): Add bounds checks to prevent panic on malformed CEA-708 data #2561
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/1817
Author: @cfsmp3
Created: 12/14/2025
Status: ✅ Merged
Merged: 12/14/2025
Merged by: @cfsmp3
Base:
master← Head:fix/issue-1616-mp4-hls-crash📝 Commits (2)
e852057fix(rust): Add bounds checks to prevent panic on malformed CEA-708 data633d844fix(rust): cast c_long to i64 in pic.rs for Windows compatibility📊 Changes
2 files changed (+100 additions, -3 deletions)
View changed files
📝
src/rust/src/decoder/service_decoder.rs(+95 -2)📝
src/rust/src/es/pic.rs(+5 -1)📄 Description
Summary
Fixes #1616 - Segmentation fault when extracting from MP4 remuxed from HLS
Fixes #1575 - Regression bug causing ccextractor 0.94 to crash
The CEA-708 decoder could panic when processing truncated or malformed caption data blocks. This PR adds proper bounds checking to prevent panics:
Fixed EXT1 command handling in
process_service_block():&block[1..]to&block[(i+1)..]for correct slice offset when EXT1 appears at non-zero positionsAdded bounds checks in
handle_extended_char():block[0]block.len() >= 2before accessingblock[1]for C3 commandsFixed clippy warning in
es/pic.rs:as i64castTest plan
test_handle_extended_char_empty_blocktest_handle_extended_char_c3_insufficient_bytestest_process_service_block_ext1_at_endtest_process_service_block_ext1_with_truncated_c3🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.