From 251d2b4072184e099f0bad86bdefbed106aa834d Mon Sep 17 00:00:00 2001 From: Lwine <1191286779@qq.com> Date: Sun, 21 Apr 2024 19:02:14 +0800 Subject: [PATCH] * Fix memory leak in `FFmpegFrameGrabber` when decoding from `InputStream` (pull #2214) --- CHANGELOG.md | 1 + src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b72bc90a..ba777193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Fix memory leak in `FFmpegFrameGrabber` when decoding from `InputStream` ([pull #2214](https://github.com/bytedeco/javacv/pull/2214)) * Upgrade dependencies for FFmpeg 7.0 ### January 29, 2024 version 1.5.10 diff --git a/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java b/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java index 84a317eb..034f247a 100644 --- a/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java +++ b/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java @@ -286,7 +286,7 @@ public synchronized void releaseUnsafe() throws Exception { avio = null; } if (oc != null) { - avformat_free_context(oc); + avformat_close_input(oc); oc = null; } }