-
Notifications
You must be signed in to change notification settings - Fork 572
[BUG] --hardsubx --tickertext bypasses subtitle output and leaves debug side effects #2229
Description
CCExtractor version: 0.96.5
Necessary information
- Is this a regression (i.e. did it work before)? Unknown
- What platform did you use? Linux
- What were the used arguments?
--hardsubx --tickertext input.mp4
Summary
The --hardsubx --tickertext path appears to be incomplete.
--tickertext is documented as searching for burned-in ticker text at the bottom of the screen, but the current implementation does not send OCR results through the normal subtitle output path.
Instead, it:
- prints ticker OCR text with
printf() - writes debug JPEG files into the current working directory
- never frees the returned Rust string
- calls
strlen()without a NULL check
As a result, the ticker-text path appears to bypass subtitle encoding entirely even though it is exposed as a user-facing option.
Code
src/lib_ccx/hardsubx.c
if (ctx->tickertext)
hardsubx_process_frames_tickertext(ctx, enc_ctx);src/lib_ccx/hardsubx_decoder.c
ticker_text = _process_frame_tickertext(ctx, ctx->rgb_frame,
ctx->codec_ctx->width,
ctx->codec_ctx->height,
frame_number);
printf("frame_number: %d\n", frame_number);
if (strlen(ticker_text) > 0)
printf("%s\n", ticker_text);There is no add_cc_sub_text() / encode_sub() call in hardsubx_process_frames_tickertext(), so enc_ctx is never used.
src/rust/src/hardsubx/decoder.rs
let write_path: String = format!("./lum_im{}.jpg", index);
pixWrite(write_path_c, lum_im, IFF_JFIF_JPEG as i32);
let write_path: String = format!("./im{}.jpg", index);
pixWrite(write_path_c, lum_im, IFF_JFIF_JPEG as i32);
subtitle_textThe Rust helper writes JPEGs unconditionally and returns a string to C, but the C caller does not call free_rust_c_string(ticker_text).
Expected behavior
--hardsubx --tickertext should route OCR results through the normal subtitle output flow and should not leave debug-only side effects in normal runs.
Suggested Fix
- send ticker OCR results through
add_cc_sub_text()/encode_sub() - remove or guard the
pixWrite()calls behind a debug option - add
free_rust_c_string(ticker_text)in the ticker-text path - add a NULL check before
strlen(ticker_text)