Skip to content

Commit 083a606

Browse files
committed
fix: Add syntax check for SCTE 20 marker bit
This adds a validation check for the SCTE 20 marker bit in es_userdata.c. If the bit is 0, a debug warning is logged. This prevents potential parsing issues with corrupt streams.
1 parent 0626bb5 commit 083a606

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

docs/CHANGES.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Fix: Delete empty output files instead of leaving 0-byte files (#1282)
1313
- Fix: --mkvlang now supports BCP 47 language tags (e.g., en-US, zh-Hans-CN) and multiple codes
1414
- Fix: segmentation fault when using --multiprogram
15+
- Fix: Add syntax check for SCTE 20 marker bit to prevent incorrect parsing of corrupt streams
1516

1617
0.96.5 (2026-01-05)
1718
-------------------

src/lib_ccx/es_userdata.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ int user_data(struct encoder_ctx *enc_ctx, struct lib_cc_decode *dec_ctx, struct
161161
skip_bits(ustream, 5); // line_offset - unused
162162
cc_data1 = (unsigned int)read_bits(ustream, 8);
163163
cc_data2 = (unsigned int)read_bits(ustream, 8);
164-
read_bits(ustream, 1); // TODO: Add syntax check */
164+
if (read_bits(ustream, 1) == 0)
165+
{
166+
dbg_print(CCX_DMT_VERBOSE, "SCTE 20: Marker bit is 0 (should be 1)\n");
167+
}
165168

166169
if (ustream->bitsleft < 0)
167170
fatal(CCX_COMMON_EXIT_BUG_BUG, "In user_data: ustream->bitsleft < 0. Cannot continue.");

0 commit comments

Comments
 (0)