-
Notifications
You must be signed in to change notification settings - Fork 527
Fix: Prevent AVC segfault in report-only mode (-out=report)
#2024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 2028754...:
Your PR breaks these cases:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 2028754...:
Your PR breaks these cases:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
|
Thank you for working on this fix! However, I'm closing this PR in favor of #2025, which takes a simpler approach that doesn't break existing tests. Why this PR breaks testsThe guard conditions are too aggressive: if (!enc_ctx || !enc_ctx->timing || !dec_ctx || !dec_ctx->avc_ctx)This checks 4 conditions, but only
The CI shows 10+ test failures including The simpler fix (#2025)PR #2025 adds the guard at the Rust FFI boundary with minimal checks: if enc_ctx.is_null() {
return avcbuflen;
}This precisely targets the report-only mode case (where Location considerationThe fix belongs at the Rust FFI boundary (inside
Thank you again for identifying this issue and submitting a fix! Your contribution helped highlight the problem. |
|
Thanks for the review and explanation. I see the issue now, I was checking too many things when only the |
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