mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2012] fix(rust): Remove dead code returning pointer to stack variable #2818
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/2012
State: closed
Merged: Yes
Summary
Removes unused
impl FromCType<*mut PMT_entry> for *mut PMTEntrywhich contained a critical bug: returning a pointer to a stack-allocated value (undefined behavior).Problem
The deleted code did this:
When the function returns,
pmt_entryis destroyed and the pointer becomes dangling.Why delete instead of fix?
This code was never called anywhere in the codebase:
demuxer.rs:279uses the value-returning variant:PMTEntry::from_ctype(*buffer_ptr)Box::into_raw(Box::new(PMTEntry::from_ctype(...)?))Rather than fix dead buggy code (and introduce memory ownership complexity), just delete it.
Verification
Related
Supersedes #1988 which attempted to fix this bug rather than delete the dead code.
🤖 Generated with Claude Code