fix(hardsubx): Fix crash in _dinit_hardsubx due to incorrect freep usage

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 <noreply@anthropic.com>
This commit is contained in:
Carlos Fernandez
2025-12-19 04:33:11 +01:00
parent 0ef7227d7e
commit 0e815c6e2d

View File

@@ -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);
}