Fix: Add missing SCTE-20 marker bit syntax check (resolves TODO)#2130
Open
pranavshar223 wants to merge 1 commit intoCCExtractor:masterfrom
Open
Fix: Add missing SCTE-20 marker bit syntax check (resolves TODO)#2130pranavshar223 wants to merge 1 commit intoCCExtractor:masterfrom
pranavshar223 wants to merge 1 commit intoCCExtractor:masterfrom
Conversation
8277745 to
381489f
Compare
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 6f7ce27...:
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. |
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 6f7ce27...:
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. |
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):
My familiarity with the project is as follows (check one):
Description
This PR resolves an outstanding
TODO: Add syntax checkwithin the SCTE-20 parsing loop, improving the parser's resilience against corrupted or malformed video streams.According to the SCTE-20 broadcast specification, each caption block is encoded in a 26-bit structure (containing priority, field number, line offset, and two bytes of caption data). The specification mandates that this 26-bit sequence must strictly end with a trailing 1-bit, which acts as a synchronization and marker bit.
Previously, the parser read this trailing bit to advance the stream but discarded it without evaluation. If a stream suffered from corruption or misalignment, causing the marker bit to evaluate to
0, the parser would blindly accept the corruptedcc_data1andcc_data2payloads, potentially resulting in garbage characters being sent to the subtitle decoder.Changes Made
I have synchronized this fix across both the original C codebase and the Rust port to maintain parity.
marker_bit == 0, the stream is locally corrupted. The parser now logs a verbose debug warning (user_data: SCTE-20 syntax error - marker bit is 0).0is detected, the parser triggers acontinueto skip processing the current corrupted block.cc_dataarray is pre-initialized with zeros at the start of the function ([0u8; 3 * 31 + 1]), skipping the block execution safely leaves those specific bytes as0x00 0x00 0x00. The caption decoding engine natively recognizes0x00as an invalid/empty payload and will safely ignore it without crashing or rendering garbage text.Files Modified
src/lib_ccx/es_userdata.csrc/rust/src/es/userdata.rsTesting
cargo checkpasses successfully with no warnings../buildscript.