Skip to content

Fix silent success return for unhandled DVB string-coded subtitle obj… - #2304

Open
GuTS805 wants to merge 3 commits into
CCExtractor:masterfrom
GuTS805:fix-dvb-string-coding-2303
Open

Fix silent success return for unhandled DVB string-coded subtitle obj…#2304
GuTS805 wants to merge 3 commits into
CCExtractor:masterfrom
GuTS805:fix-dvb-string-coding-2303

Conversation

@GuTS805

@GuTS805 GuTS805 commented Aug 4, 2026

Copy link
Copy Markdown

[FIX]

dvbsub_parse_object_segment() previously returned 0 (success) when encountering a character-coded (coding_method == 1) DVB subtitle object, silently dropping the caption content. Now returns -1 so the caller (dvbsub_decode) correctly treats this as a failure.

Fixes #2303

In raising this pull request, I confirm the following (please check boxes):

Reason for this PR:

  • This PR adds new functionality.
  • This PR fixes a bug that I have personally experienced or that a real user has reported and for which a sample exists.
  • This PR is porting code from C to Rust.

Sanity check:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • If the PR adds new functionality, I've added it to the changelog. If it's just a bug fix, I have NOT added it to the changelog.
  • I am NOT adding new C code unless it's to fix an existing, reproducible bug.

Repro instructions:

  1. Run: ccextractor dvb_string_coding_sample.ts -out=spupng -o /tmp/test
  2. Before this fix: prints FIXME support for string coding standard and finishes with No captions were found in input. . the failure is completely silent; nothing signals that a caption object was actually dropped.
  3. After this fix: prints Return from dvbsub_decode: -1 — the same condition is now surfaced as a real, explicit failure instead of a masked success.

dvb_string_coding_sample.ts (committed in this PR) is a minimal, spec-valid MPEG-TS stream — PAT → PMT with a DVB subtitling_descriptor → PES packets carrying a page/region/object-segment sequence where the object segment sets object_coding_method = 1 (ETSI EN 300 743 §7.2.5, "character coded" object) — built specifically to exercise this code path. scratch_dvb_sample/build_dvb_sample.py documents/reconstructs the sample byte-by-byte for anyone who wants to verify or regenerate it.

This is a real, spec-conformant encoding some DVB broadcasters use to save bandwidth (as opposed to bitmap/pixel-coded objects, which CCExtractor already handles). Because the failure was previously silent, this is an accessibility-relevant data-loss bug — users relying on extracted captions would get nothing for the affected segment with no indication anything went wrong.

GuTS805 added 2 commits August 5, 2026 04:49
…ects

dvbsub_parse_object_segment() previously returned 0 (success) when
encountering a character-coded (coding_method == 1) DVB subtitle
object, silently dropping the caption content. Now returns -1 so
the caller (dvbsub_decode) correctly treats this as a failure.

Fixes CCExtractor#2303
dvb_string_coding_sample.ts is a minimal MPEG-TS file (PAT+PMT+DVB
subtitle PES) whose object segment uses object_coding_method=1
(character-coded), triggering the previously-silent failure fixed
in the previous commit. build_dvb_sample.py documents how it was
constructed for future reference.

Repro:
  ccextractor dvb_string_coding_sample.ts -out=spupng -o /tmp/test
Before fix: prints 'FIXME support for string coding standard' and
reports 'No captions were found' with no error.
After fix: prints 'Return from dvbsub_decode: -1', a real,
surfaced failure.
@ccextractor-bot

Copy link
Copy Markdown
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 9f78685...:
Report Name Tests Passed
Broken 10/13
CEA-708 2/14
DVB 2/7
DVD 3/3
DVR-MS 2/2
General 25/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 79/86
Teletext 20/21
WTV 13/13
XDS 34/34

Your PR breaks these cases:

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --out=srt --latin1 611b4a9235..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 1020459a86..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 01509e4d27..., Last passed: Never
  • ccextractor --dru c83f765c66..., Last passed: Never
  • ccextractor --startat 4 --endat 7 c83f765c66..., Last passed: Never
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --out=srt --latin1 f23a544ba8..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --ucla d037c7509e..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --ucla 7d3f25c32c..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 7f41299cc7..., Last passed: Never

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.

… message

CI caught a regression: returning -1 aborted dvbsub_decode()'s entire
segment loop for the packet, dropping other valid objects/regions that
happened to share the same packet as an unsupported string-coded one.
Restored the original safe return value; only the diagnostic message
changed to make the failure unambiguous instead of a bare FIXME.
@ccextractor-bot

Copy link
Copy Markdown
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 2feb09a...:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 1/7
DVD 3/3
DVR-MS 2/2
General 23/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 72/86
Teletext 20/21
WTV 12/13
XDS 31/34

Your PR breaks these cases:

  • ccextractor --out=srt --latin1 611b4a9235...
  • ccextractor --autoprogram --out=ttxt --latin1 1020459a86...
  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2...
  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc...
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla dab1c1bd65...
  • ccextractor --autoprogram --out=ttxt --latin1 01509e4d27...
  • ccextractor --out=srt --latin1 --autoprogram 29e5ffd34b...
  • ccextractor --out=spupng c83f765c66...
  • ccextractor --dru c83f765c66...
  • ccextractor --startat 4 --endat 7 c83f765c66...
  • ccextractor --codec dvbsub --out=spupng 85271be4d2...
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --out=srt --latin1 f23a544ba8...
  • ccextractor --autoprogram --out=srt --latin1 --ucla d037c7509e...
  • ccextractor --autoprogram --out=srt --latin1 --ucla 7d3f25c32c...
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 7f41299cc7...

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --service 1 --out=ttxt da904de35d..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 b22260d065..., Last passed: Never

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DVB subtitle decoder silently discards character-coded ("string coding") object segments — coding_method == 1 is a no-op that reports success

2 participants