Repository navigation
[FIX] Skip malformed SCC hex words without aborting - #2451
Open
harshalsp07 wants to merge 1 commit into
Open
harshalsp07 wants to merge 1 commit into
harshalsp07 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
An SCC word such as
a€passes the four-byte length check, then panics whenparse_hex_pair()slices inside the UTF-8 character. At the C/Rust boundary this aborts CCExtractor with SIGABRT.Check that all four bytes are ASCII hex digits before slicing. Invalid words are skipped, matching the parser's existing handling of malformed hex, and the valid caption data around them is kept. This also rejects signed words such as
+120thatfrom_str_radix()would otherwise accept.Reproduce from the repository root with the included 95-byte sample:
On master
d7eb132e, this aborts withend byte index 2 is not a char boundary. With this change it exits 0 and writes theHIcaption.Tested on Linux:
cargo test --lockedinsrc/rust: 428 passed. Both new regression tests fail without the fix.cargo fmt --all -- --checkandcargo clippy -- -D warningspass.Windows/macOS and the external sample platform haven't been tested.
CI note: The initial Linux build stops before compilation because
libgpac-devhas no installation candidate on Ubuntu 26.04; #2428 addresses the runner change. The C format check also flagsccx_decoders_isdb.candmp4.c, which are unchanged from master.