mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
[BUG]: Segmentation fault in report-only(-out=report) mode when processing AVC/H.264 streams with Rust decoder #902
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?
Originally created by @x15sr71 on GitHub (Jan 16, 2026).
Summary
CCExtractor crashes with a segmentation fault when running in report-only mode (
-out=report) on files containingAVC/H.264video streams when the Rust AVC decoder is enabled (default in recent builds).Command used
Where
input.tsis any transport stream file containing H.264 video.Segmentation fault
Expected behavior
CCExtractor should generate a report without crashing, as report generation does not require video decoding.
Actual behavior
Segmentation fault (SIGSEGV) at address
0x50when attempting to dereferenceencoder_ctx->timinginside the Rust AVC decoder.Root cause
The crash occurs because:
Report-only mode (
-out=report) does not initialize video decoding structures, specifically:encoder_ctx->timingremainsNULLlib_cc_decode->avc_ctxmay remainNULLThe Rust AVC decoder (
ccxr_process_avc) assumes these structures are always initialized and dereferences them unconditionallyThe C→Rust boundary in
process_avc()does not validate these preconditions before calling into RustTechnical details
Crash location(lldb):
Call stack:
Proposed Solution
Add a guard at the C-Rust boundary in
process_avc()that skips AVC processing when the decoder isn't fully initialized (like in report-only mode).