[FFmpeg-devel] [PATCH] boxblur: fix huge memleak in end_frame().

Michael Niedermayer michaelni at gmx.at
Fri Nov 25 00:17:15 CET 2011

On Thu, Nov 24, 2011 at 08:45:26PM +0100, Clément Bœsch wrote:
> ---
> Hi,
> I have absolutely no idea why this is actually needed here (where are those
> buffer "referenced"? isn't it supposed to be free'd by the code allocating
> it?), but it seems to fix a huge memleak in this filter. Easily reproducible
> with something like: ./ffplay -f lavfi mandelbrot,boxblur=2:2; ~50MB/sec lost
> here.

As the filter uses the default start frame, the cleanup done by the
default end frame is needed.

does the following work for you ?

diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
index db1b579..ddb4b25 100644
--- a/libavfilter/vf_boxblur.c
+++ b/libavfilter/vf_boxblur.c
@@ -325,7 +325,7 @@ static void end_frame(AVFilterLink *inlink)

     avfilter_draw_slice(outlink, 0, inlink->h, 1);
-    avfilter_end_frame(outlink);
+    avfilter_default_end_frame(inlink);

 AVFilter avfilter_vf_boxblur = {


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111125/8ba72f68/attachment.asc>

More information about the ffmpeg-devel mailing list