aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-07-08 04:20:22 +0200
committerAnton Khirnov <anton@khirnov.net>2012-07-20 21:07:32 +0200
commit7155763b78fcc1f158e02f4d44d251a1e597f0cc (patch)
tree94eeb7c4c30cdd3f84ce284cf384e80f95f77efc /libavfilter
parentd19499c7960fba97e6142dc72d49825e834e3419 (diff)
downloadffmpeg-7155763b78fcc1f158e02f4d44d251a1e597f0cc.tar.gz
vf_drawtext: don't give up its own reference to the input buffer.
Directly forwarding the input buffer to the next filter means that drawtext no longer owns any references to it and thus shouldn't refer to it in any way.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_drawtext.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 22a9480aba..fd2ec8deae 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -812,6 +812,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
{
AVFilterContext *ctx = inlink->dst;
DrawTextContext *dtext = ctx->priv;
+ AVFilterBufferRef *buf_out;
int fail = 0;
if (dtext_prepare_text(ctx) < 0) {
@@ -850,7 +851,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
(int)dtext->var_values[VAR_N], dtext->var_values[VAR_T],
dtext->x, dtext->y, dtext->x+dtext->w, dtext->y+dtext->h);
- ff_start_frame(inlink->dst->outputs[0], inpicref);
+ buf_out = avfilter_ref_buffer(inpicref, ~0);
+ ff_start_frame(inlink->dst->outputs[0], buf_out);
}
static void end_frame(AVFilterLink *inlink)
@@ -866,6 +868,7 @@ static void end_frame(AVFilterLink *inlink)
ff_draw_slice(outlink, 0, picref->video->h, 1);
ff_end_frame(outlink);
+ avfilter_unref_buffer(inlink->cur_buf);
}
AVFilter avfilter_vf_drawtext = {