[FFmpeg-cvslog] vf_pad: don't give up its own reference to the output buffer.

Anton Khirnov git at videolan.org
Thu Oct 25 17:10:49 CEST 2012


ffmpeg | branch: release/0.10 | Anton Khirnov <anton at khirnov.net> | Sun Jul  8 17:01:17 2012 +0200| [be209bdabb11c59de17220bdbf0bf9c9f7cc16f5] | committer: Anton Khirnov

vf_pad: don't give up its own reference to the output buffer.

Conflicts:
	libavfilter/vf_pad.c

Fixes Bug 245

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be209bdabb11c59de17220bdbf0bf9c9f7cc16f5
---

 libavfilter/vf_pad.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 9ba91ed..8f583da 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -300,6 +300,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
 {
     PadContext *pad = inlink->dst->priv;
     AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
+    AVFilterBufferRef *for_next_filter;
     int plane;
 
     for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {
@@ -336,12 +337,14 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     outpicref->video->w = pad->w;
     outpicref->video->h = pad->h;
 
-    avfilter_start_frame(inlink->dst->outputs[0], outpicref);
+    for_next_filter = avfilter_ref_buffer(outpicref, ~0);
+    avfilter_start_frame(inlink->dst->outputs[0], for_next_filter);
 }
 
 static void end_frame(AVFilterLink *link)
 {
     avfilter_end_frame(link->dst->outputs[0]);
+    avfilter_unref_buffer(link->dst->outputs[0]->out_buf);
     avfilter_unref_buffer(link->cur_buf);
 }
 



More information about the ffmpeg-cvslog mailing list