mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-27 08:31:32 +00:00
[PR #1707] fix: XDS segmentation faults #2428
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/1707
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):
The regression tests under the XDS category have been failing on Windows due to segmentation faults for a while now. The cause for these errors stem from a small mistake that was made when the CEA-708 decoder functions were ported to Rust.
In specific, here is the offending line:
To contrast, here is the equivalent C section:
window.rowshas the following definition:As we can see, it is an array of pointers where each pointer points to a heap allocated row of
dtvcc_symbols. In rust, this structure is incorrectly assumed to be an array ofdtvcc_symbols. I've fixed this by using pointer arithmetic in rust to do the proper operation:The unit tests which directly utilize this operation were also leaking memory due to this, and thus I've made helper functions to properly handle those as well.