mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user