mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
[PR #1817] fix(rust): Add bounds checks to prevent panic on malformed CEA-708 data #2565
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?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1817
State: closed
Merged: Yes
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