From 69b8d83ecf5f6deb9ad94bdaa816aa205430d3e9 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 19 Dec 2010 13:02:05 +0000 Subject: [PATCH] Fix crash in gradfun:end_frame() when inpic == outpic, so it has to be freed just once. Originally committed as revision 26058 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavfilter/vf_gradfun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 1cbf8d8c2a..3a400a04eb 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -228,7 +228,8 @@ static void end_frame(AVFilterLink *inlink) avfilter_draw_slice(outlink, 0, inlink->h, 1); avfilter_end_frame(outlink); avfilter_unref_buffer(inpic); - avfilter_unref_buffer(outpic); + if (outpic != inpic) + avfilter_unref_buffer(outpic); } AVFilter avfilter_vf_gradfun = {