[Enhance] Implement syntax check for marker bits in `es_userdata.c`
Description
In ccextractor/src/lib_ccx/es_userdata.c at line 164, a marker bit is read during the parsing of MPEG-2 User Data or H.264 SEI captions, but its value is not currently validated.
According to standards like ATSC A/53 Part 4, these structures often contain "marker bits" or "reserved bits" that are required to be set to 1 to maintain bitstream alignment and prevent start-code emulation.
Currently, the code reads the bit but does not verify its value. If this bit is 0, it indicates either a non-compliant stream or potential corruption, which could lead to "garbage" text or synchronization issues in the output.
Proposed Solution
The implementation should capture the bit value and verify that it matches the expected value (1). If the check fails, the system should log a warning using CCExtractor's internal logging mechanism.
Implementation Plan
- Capture the result of
read_bits(ustream, 1). - Compare the value to the expected marker (
1). - If the value is incorrect, trigger a
dbg_printorccx_common_loggingwarning with theCCX_DMT_VERBOSEflag. - Decide whether to continue parsing (standard behavior for robustness) or set a flag to skip the current packet if strict mode is enabled.
This is not an issue - let's not create one issue for each supersmall thing
Ok Understood, Carlos. I only created the issue to have a reference to link with the PR, but I understand the project's policy now. I'll make sure to skip the issue tracker for minor fixes like this moving forward. Thanks for the guidance! @cfsmp3