fix: memory leaks in WebmEncoder.createEncoder and stop (#65)
Riajul committed
- Author
- Riajul · 93116400+rjriajul@users.noreply.github.comJul 6, 2026 at 14:53
- Committer
- GitHub · noreply@github.comJul 6, 2026 at 14:53
- Parents
- d25807439527
fix: memory leaks in WebmEncoder.createEncoder and stop (#65) - Add free_encoder() helper that safely NULL-checks and frees all encoder resources in reverse allocation order - Fix all 11 error paths in createEncoder() to call ReleaseStringUTFChars and free_encoder(ctx) before returning - Fix stop() to guard flush/trailer by both fmt_ctx and codec_ctx - Fix stop() using return instead of break on receive error, which skipped cleanup entirely - Deduplicate inline cleanup in stop() by reusing free_encoder() - Fix inconsistent bare return 0 (was return (jlong)0) Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Co-authored-by: MiniMax-M3 <model@minimax.io>
1 file changed+35−31