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

Anton Khirnov git at libav.org
Fri Jan 4 08:09:20 CET 2013


Module: libav
Branch: release/0.7
Commit: 8168a7cec951b34947c55bb14a1ba2f987ab13a3

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Reinhard Tartler <siretart at tauware.de>
Date:      Sun Jul  8 17:01:17 2012 +0200

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>

---

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

diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index d4d2b20..ef7cc88 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -299,6 +299,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++) {
@@ -335,12 +336,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 libav-commits mailing list