mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-08 13:34:59 +00:00
[PR #2024] Fix: Prevent AVC segfault in report-only mode (-out=report)
#2829
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/2024
State: closed
Merged: No
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
This PR fixes a segmentation fault that occurs (as reported in issue #2023) when running CCExtractor in report-only mode (
-out=report) on files containing AVC (H.264) video streams with the Rust AVC decoder enabled.Problem
When running:
on transport streams containing AVC/H.264 video, CCExtractor crashes with a segmentation fault.
Solution
Add a defensive guard at the C → Rust FFI boundary in
process_avc()to skip AVC processing when the decoder context isn't fully initialized (such as in report-only mode).Guard Conditions
Skip calling the Rust AVC decoder if any of the following are true:
encoder_ctxis NULLencoder_ctx->timingis NULLlib_cc_decodeis NULLlib_cc_decode->avc_ctxis NULLIn these cases,
process_avc()simply returns without invoking the Rust decoder.Rationale
process_avc(); no changes to Rust internals