mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[BUG] Segmentation fault when extracting from MP4 which remuxed from HLS #806
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @szescxz on GitHub (Jun 9, 2024).
CCExtractor version: 0.94
In raising this issue, I confirm the following:
Necessary information
Yes, works with 0.87
Tested on both Windows and Linux
-out=srtVideo links
https://github.com/CCExtractor/ccextractor/assets/49463229/fe90d91d-6a1e-4cf3-8143-6083e4ccdf7a
Original HLS source (requires US IP): https://tve-vod-preview.cdn.turner.com/toon/c26e41c4570090fca8e550ecca41df0b/layer1/layer1.m3u8
Additional information
With version 0.94, CCExtractor only extracts when I remux the HLS stream to MPEGTS with
ffmpeg -i <hls link> -c copy test.ts. If I remux it to MP4 (ffmpeg -i test.ts -c copy test.mp4), CCExtractor throws aSegmentation fault.@x15sr71 commented on GitHub (Oct 24, 2025):
Hi @szescxz,
Thanks for reporting this issue. I’ve tested your scenario with CCExtractor 0.94 on a remuxed MP4 from HLS. In the current build, I’m not able to reproduce the segmentation fault — both TS and MP4 inputs are processed safely, and the program exits gracefully if no captions are found.
It looks like the MP4 parser has been improved, so the crash you observed no longer occurs.
Could you please confirm if you are still seeing this issue?
@szescxz commented on GitHub (Oct 24, 2025):
@x15sr71 Yes, with the sample MP4 file I have provided in the original post.
Fresh attempt under Windows 11:
59cffdba1acceca982917ece49690cd226a7e132acf1dbb70afaf74703387d17ad18f14157feb3c2bbe44e9adc1d43328f66d8f4265cc1e71c2047b653222a7e)ed3e27e04fa310011246ad2ced834e2ff143bce6099df893baf48adfa17ddc00bd6a121d04d612fd17b0cdcc747378eba6e9829bb6344cc367612bcdf7a10771)ccextractorwinfull.exe -out=srt path_to.mp4Truncated output:
@x15sr71 commented on GitHub (Oct 26, 2025):
Hi @szescxz,
Good news! I've investigated this issue and confirmed that the bug has already been fixed in the current master branch.
The Problem
The v0.94 crash occurred because, after the port of the C-based 708 decoder to Rust (introduced after version 0.87), the code accessed
block[0]andblock[1]in/src/rust/src/decoder/service_decoder.rswithout validating that the block had sufficient data, causing a panic when processing your remuxed MP4 file with truncated CEA-708 caption data.The Fix
The current master includes comprehensive bounds validation:
block[0]handle_C3before processing C3 commandsI've verified with your sample file that the current master processes it without crashing.
What This Means
Since the fix is already in master, it should be included in the next release. In the meantime you can build from master.
This fix was implemented sometime after the v0.94 release (likely in 2024 based on commit history).
Thank you for the detailed bug report with reproduction steps!
@cfsmp3 @canihavesomecoffee @pszemus – just wanted to bring this to your attention. Could you please advise if this issue should be closed now or kept open until the next release is tagged?