summaryrefslogtreecommitdiff
path: root/libavfilter/vf_vpp_qsv.c
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2018-04-03 09:50:20 +0800
committerMark Thompson <sw@jkqxz.net>2018-04-21 19:00:43 +0100
commitd865783b6c8d4f96f5094ed72eff0f5a4a4908af (patch)
treedd27be107794f95b5fd12fd09e80c57087e460e5 /libavfilter/vf_vpp_qsv.c
parentf3341a0452419c57faf4d28aebb24be5d41312f3 (diff)
downloadffmpeg-d865783b6c8d4f96f5094ed72eff0f5a4a4908af.tar.gz
lavf/qsv: clone the frame which may be managed by framework
For filters based on framesync, the input frame was managed by framesync, so we should not directly keep and destroy it, instead we make a clone of it here, or else double-free will occur. But for other filters not based on framesync, we still need to free the input frame inside filter_frame. Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Diffstat (limited to 'libavfilter/vf_vpp_qsv.c')
-rw-r--r--libavfilter/vf_vpp_qsv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 6be7098ae9..41a9f38962 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -341,9 +341,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
VPPContext *vpp = inlink->dst->priv;
AVFilterLink *outlink = ctx->outputs[0];
- if (vpp->qsv)
+ if (vpp->qsv) {
ret = ff_qsvvpp_filter_frame(vpp->qsv, inlink, picref);
- else {
+ av_frame_free(&picref);
+ } else {
if (picref->pts != AV_NOPTS_VALUE)
picref->pts = av_rescale_q(picref->pts, inlink->time_base, outlink->time_base);
ret = ff_filter_frame(outlink, picref);