[BUG] Infinite binary output when processing .ts files with no subtitles #845

Closed
opened 2026-01-29 16:54:57 +00:00 by claunia · 2 comments
Owner

Originally created by @AbHash-RixE on GitHub (Oct 8, 2025).


CCExtractor version: Version: 0.94


Necessary information

  • Is this a regression (i.e. did it work before)? YES
  • What platform did you use? Linux
  • What were the used arguments? ./ccextractor output_clean.ts

💬 Additional information

When CCExtractor is run on a .ts file that contains no subtitles, it produces infinite binary-like output in the terminal instead of stopping gracefully.

Observed behavior

The terminal continuously floods with binary/hex-like data, for example:

00000000 | 44 54 47 31 41 FE 00 00 00 00 01 01 33 7C 75 EF  | DTG1Aþ      3|uï
00000016 | DD 52 6D A1 2A 49 62 F7 BC 07 B6 B4 26 A9 25 49  | ÝRm¡*Ib÷¼ ¶´&©%I
00000032 | 2C 5B 19 11 BA 6D B5 4F F1 6D 1E F7 80 F7 6B 17  | ,[  º I  ÛC[ òú
00000064 | 01 2E D6 7E FB E6 C0 12 ED 64 66 C0 FA C9 24 1C  |  .Ö~ûæÀ ídfÀúÉ$ 
00000080 | D4 6D A3 EB 66 EF 9E 40 05 3B 58 8B EF 90 01 4E  | Ôm£ëfïïï  cVîÑ
00000000 | 44 54 47 31 41 FE 00 00 00 01 01 4A EF 5D 4B A0  | DTG1ÎønuÍÎKýÿ]K 
00000048 | 5C EB FE 85 17 D3 D7 3A 79 A5 D0 10 92 59 81 15  | \ëþ·
 Ó×:y¥Ð Y 
00000064 | 26 19 87 52 0E 97 A1 00 00 01 02 4A AE A6 0C 48  | & ()   nMI BAS 
00000096 | 36 92 07 DB 30 20 E9 AA 4C 08 28 2C AA 62 D2 43  | 6 Û0 éªL (,ªbÒC
00000112 | 61 42 63 77 CE A9 81 05 26 06 36 06 15 20 22 A9  | aBcwΩ & 6   "©
00000000 | 44 54 47 31 41 FE 00 00 00 01 01 52 AE A4 0D 4C  | DTG1Aþ     R®¤ L
00000016 | 10 10 69 30 7D 24 0A 8A A6 0D 48 1A B0 00 00 00  |   i0}$ ¦ H °   
00000032 | 00 01 02 52 AE A6 0C 48 A2 3E 4D 23 50 50 2B 2E  |   £ a]JH¢>M#PP+.
00000064 | 83 41 71 01 89 1A EB 94 79 D5 30 34 A4 80 86 80  | Aq 	 ëyÕ04¤
00000080 | 84 21 CF 39 B9 A6 9A AC 2A A0 85 0F CF 13 39 94  |

Expected behavior

If the input file contains no subtitles, CCExtractor should:

  • Exit normally with a message such as “No subtitles found.”
  • Not produce binary data or infinite console output.
  • Extract subtitle if present.

Working version

Version: 0.94
Git commit: 911b2b8ded2e1d147fe32b800ae96885829c1525
Compilation date: 2025-10-05
CEA-708 decoder: Rust
File SHA256: aa40ad722cc67b9d27fc75f34795bc4f15c1f28c4b922017e68826e4e45d126e

Broken version

Version: 0.94
Git commit: ebd8252b8855e245c14fcf4169bec47922d66300
Compilation date: 2025-10-08
CEA-708 decoder: (empty)
File SHA256: 416a00c0b15ecef9fcaf3e9f1e5ef490aba39d367f0b98ab6b2247545884dd64
Originally created by @AbHash-RixE on GitHub (Oct 8, 2025). --- **CCExtractor version:** Version: 0.94 --- ### Necessary information - Is this a regression (i.e. did it work before)? YES - What platform did you use? Linux - What were the used arguments? ` ./ccextractor output_clean.ts ` --- ### 💬 Additional information When CCExtractor is run on a .ts file that contains no subtitles, it produces infinite binary-like output in the terminal instead of stopping gracefully. #### Observed behavior The terminal continuously floods with binary/hex-like data, for example: ``` 00000000 | 44 54 47 31 41 FE 00 00 00 00 01 01 33 7C 75 EF | DTG1Aþ 3|uï 00000016 | DD 52 6D A1 2A 49 62 F7 BC 07 B6 B4 26 A9 25 49 | ÝRm¡*Ib÷¼ ¶´&©%I 00000032 | 2C 5B 19 11 BA 6D B5 4F F1 6D 1E F7 80 F7 6B 17 | ,[ º I ÛC[ òú 00000064 | 01 2E D6 7E FB E6 C0 12 ED 64 66 C0 FA C9 24 1C | .Ö~ûæÀ ídfÀúÉ$ 00000080 | D4 6D A3 EB 66 EF 9E 40 05 3B 58 8B EF 90 01 4E | Ôm£ëfïïï cVîÑ 00000000 | 44 54 47 31 41 FE 00 00 00 01 01 4A EF 5D 4B A0 | DTG1ÎønuÍÎKýÿ]K  00000048 | 5C EB FE 85 17 D3 D7 3A 79 A5 D0 10 92 59 81 15 | \ëþ· Ó×:y¥Ð Y 00000064 | 26 19 87 52 0E 97 A1 00 00 01 02 4A AE A6 0C 48 | & () nMI BAS 00000096 | 36 92 07 DB 30 20 E9 AA 4C 08 28 2C AA 62 D2 43 | 6 Û0 éªL (,ªbÒC 00000112 | 61 42 63 77 CE A9 81 05 26 06 36 06 15 20 22 A9 | aBcwΩ & 6 "© 00000000 | 44 54 47 31 41 FE 00 00 00 01 01 52 AE A4 0D 4C | DTG1Aþ R®¤ L 00000016 | 10 10 69 30 7D 24 0A 8A A6 0D 48 1A B0 00 00 00 | i0}$ ¦ H ° 00000032 | 00 01 02 52 AE A6 0C 48 A2 3E 4D 23 50 50 2B 2E | £ a]JH¢>M#PP+. 00000064 | 83 41 71 01 89 1A EB 94 79 D5 30 34 A4 80 86 80 | Aq ëyÕ04¤ 00000080 | 84 21 CF 39 B9 A6 9A AC 2A A0 85 0F CF 13 39 94 | ``` #### Expected behavior If the input file contains no subtitles, CCExtractor should: - Exit normally with a message such as “No subtitles found.” - Not produce binary data or infinite console output. - Extract subtitle if present. #### Working version Version: 0.94 Git commit: 911b2b8ded2e1d147fe32b800ae96885829c1525 Compilation date: 2025-10-05 CEA-708 decoder: Rust File SHA256: aa40ad722cc67b9d27fc75f34795bc4f15c1f28c4b922017e68826e4e45d126e #### Broken version Version: 0.94 Git commit: ebd8252b8855e245c14fcf4169bec47922d66300 Compilation date: 2025-10-08 CEA-708 decoder: (empty) File SHA256: 416a00c0b15ecef9fcaf3e9f1e5ef490aba39d367f0b98ab6b2247545884dd64
Author
Owner

@DhanushVarma-2 commented on GitHub (Nov 10, 2025):

@AbHash-RixE I will work on identifying and fixing this bug!

Root Cause: Based on the issue description, the infinite loop likely occurs in the TS processing functions. I will investigate the ts_readstream function in src/lib_ccx/ts_functions.c to find where the do-while loop runs indefinitely when processing TS files with no subtitles.

Plan for Fix:

I will add a packet counter with a reasonable limit (e.g., 50,000 packets)
I will implement termination conditions when no subtitles are found after processing the limit
I will add proper tracking to detect when no caption data is present
I will ensure clean exit with appropriate messages instead of infinite binary output

Expected Changes:

I will modify the relevant TS processing functions to add proper termination logic
The goal is to ensure that:

TS files with no subtitles will exit cleanly after processing a reasonable number of packets
TS files with subtitles continue to work normally
No binary data floods the terminal
I will submit a PR once I have implemented and tested the fix. Could you let me know if you have any specific test files or additional information that would be helpful?

@DhanushVarma-2 commented on GitHub (Nov 10, 2025): @AbHash-RixE I will work on identifying and fixing this bug! Root Cause: Based on the issue description, the infinite loop likely occurs in the TS processing functions. I will investigate the ts_readstream function in src/lib_ccx/ts_functions.c to find where the do-while loop runs indefinitely when processing TS files with no subtitles. Plan for Fix: I will add a packet counter with a reasonable limit (e.g., 50,000 packets) I will implement termination conditions when no subtitles are found after processing the limit I will add proper tracking to detect when no caption data is present I will ensure clean exit with appropriate messages instead of infinite binary output Expected Changes: I will modify the relevant TS processing functions to add proper termination logic The goal is to ensure that: TS files with no subtitles will exit cleanly after processing a reasonable number of packets TS files with subtitles continue to work normally No binary data floods the terminal I will submit a PR once I have implemented and tested the fix. Could you let me know if you have any specific test files or additional information that would be helpful?
Author
Owner

@cfsmp3 commented on GitHub (Dec 29, 2025):

I'm closing this issue - 1) No sample, 2) I suspect "infinite" here is an exaggeration and that CCExtractor would eventually end after reading the whole file. Infinite would imply that it never ends and I don't think that's the case. 3) We've removed the hex dump.

@cfsmp3 commented on GitHub (Dec 29, 2025): I'm closing this issue - 1) No sample, 2) I suspect "infinite" here is an exaggeration and that CCExtractor would eventually end after reading the whole file. Infinite would imply that it never ends and I don't think that's the case. 3) We've removed the hex dump.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#845