From 0e815c6e2dd2bd9d20fb98251135f7ad7edbbc5b Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Fri, 19 Dec 2025 04:33:11 +0100 Subject: [PATCH] fix(hardsubx): Fix crash in _dinit_hardsubx due to incorrect freep usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The freep() function expects a pointer-to-pointer (void**) so it can dereference, free, and NULL-out the pointer. The code was passing lctx->dec_sub directly instead of &lctx->dec_sub. This caused freep to interpret the first 8 bytes of the cc_subtitle struct as a pointer and attempt to free() it, resulting in a crash (SIGABRT/exit code 134) in the memory allocator. Fixes Test 241 (Hardsubx) crash on Sample Platform. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/lib_ccx/hardsubx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_ccx/hardsubx.c b/src/lib_ccx/hardsubx.c index 357d63da..44236d9c 100644 --- a/src/lib_ccx/hardsubx.c +++ b/src/lib_ccx/hardsubx.c @@ -337,7 +337,7 @@ void _dinit_hardsubx(struct lib_hardsubx_ctx **ctx) TessBaseAPIDelete(lctx->tess_handle); // Free subtitle - freep(lctx->dec_sub); + freep(&lctx->dec_sub); freep(ctx); }