From a21c6884f2fef802b1f3f0ef43544434b2e4f07e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 24 Mar 2019 22:27:48 +0100 Subject: [PATCH] filter/ffmpeg: call av_frame_unref() before av_buffersink_get_frame() Fix another memory leak. Closes https://github.com/MusicPlayerDaemon/MPD/issues/514 --- src/filter/plugins/FfmpegFilter.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/filter/plugins/FfmpegFilter.cxx b/src/filter/plugins/FfmpegFilter.cxx index af90b795a..5fe0b3c38 100644 --- a/src/filter/plugins/FfmpegFilter.cxx +++ b/src/filter/plugins/FfmpegFilter.cxx @@ -66,6 +66,8 @@ FfmpegFilter::FilterPCM(ConstBuffer src) /* collect filtered data from the FFmpeg audio buffer sink */ + out_frame.Unref(); + err = av_buffersink_get_frame(buffer_sink.get(), out_frame.get()); if (err < 0) { if (err == AVERROR(EAGAIN) || err == AVERROR_EOF)