aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-07-08 17:01:17 +0200
committerAnton Khirnov <anton@khirnov.net>2012-07-20 21:08:13 +0200
commitf493c644cd9671965ba886cfaffd3aa7a648c02d (patch)
treead0480a14d871343bf30400618a146329c69b69b
parentad8b6326aa00b87a87814d11707adf31ad2eaf28 (diff)
downloadffmpeg-f493c644cd9671965ba886cfaffd3aa7a648c02d.tar.gz
vf_pad: don't give up its own reference to the output buffer.
-rw-r--r--libavfilter/vf_pad.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index de7ae0086b..037abd5d57 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -303,6 +303,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++) {
@@ -339,12 +340,14 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
outpicref->video->w = pad->w;
outpicref->video->h = pad->h;
- ff_start_frame(inlink->dst->outputs[0], outpicref);
+ for_next_filter = avfilter_ref_buffer(outpicref, ~0);
+ ff_start_frame(inlink->dst->outputs[0], for_next_filter);
}
static void end_frame(AVFilterLink *link)
{
ff_end_frame(link->dst->outputs[0]);
+ avfilter_unref_buffer(link->dst->outputs[0]->out_buf);
avfilter_unref_buffer(link->cur_buf);
}