-
Notifications
You must be signed in to change notification settings - Fork 524
Fix pmtentry clean #1988
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
base: master
Are you sure you want to change the base?
Fix pmtentry clean #1988
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 477307e...:
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 477307e...:
Your PR breaks these cases:
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. |
|
@cfsmp3 please review this PR |
Delete the unused `impl FromCType<*mut PMT_entry> for *mut PMTEntry` implementation which had a critical bug: it returned a pointer to a stack-allocated PMTEntry, causing undefined behavior (dangling pointer). This code was never called anywhere in the codebase. The actual usage in demuxer.rs uses the value-returning variant `FromCType<PMT_entry> for PMTEntry` with explicit `Box::into_raw(Box::new(...))` wrapping, which is the correct pattern. Rather than fixing dead buggy code, just remove it. Supersedes #1988 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
[FIX] Critical Rust FFI memory safety: avoid returning pointer to stack-allocated PMTEntry
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
PR fixes a use-after-scope (dangling pointer) bug in the Rust FFI layer.
The implementation of:
previously returned a raw pointer derived from a stack-allocated PMTEntry.
Once the function returned, the stack frame was destroyed, leaving the pointer
dangling and causing undefined behavior in Rust.
This is a correctness and memory-safety issue independent of C-side usage,
tests, or call order.
Fixes #1986