mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1732] fix: rust bitstream segfault #2453
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/1732
State: closed
Merged: Yes
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
This PR fixes a bug where an "exhausted" C bitstream (one that has been fully read, where pos == end) would lose its buffer context when converted to Rust and back. The current logic treats this state the same as an uninitialized stream causing the original buffer location to be lost.
The fix ensures that even an exhausted stream creates a zero-length Rust slice that retains the original base pointer so that the pointers are preserved during the conversions.