[FFmpeg-cvslog] lavf/qsvvpp: avoid the double-free when working in sys memory mode

Linjie Fu git at videolan.org
Thu May 30 11:53:29 EEST 2019


ffmpeg | branch: master | Linjie Fu <linjie.fu at intel.com> | Mon Apr 15 21:24:06 2019 +0800| [6895b350c31d8fda5bd9e4285c52de6e391e7ff4] | committer: Zhong Li

lavf/qsvvpp: avoid the double-free when working in sys memory mode

Currently, picref will be freed by calling av_frame_free(&picref) in
submit_frame() in qsvvpp.c when working in system memory mode,and normally it
is freed in filter_frame() in vf_vpp_qsv.c when working in other modes.

Double free happens when working in system memory mode, remove to
fix the memory issue.

Reproduce:
ffmpeg -init_hw_device qsv=foo -filter_hw_device foo -f rawvideo -pix_fmt nv12 -s:v 852x480 \
-i 852x480.nv12 -vf 'vpp_qsv=w=500:h=400' -f rawvideo -pix_fmt nv12 qsv.nv12

Signed-off-by: Linjie Fu <linjie.fu at intel.com>
Signed-off-by: Zhong Li <zhong.li at intel.com>

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

 libavfilter/qsvvpp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 06efdf5089..5cd1d5d345 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -316,7 +316,6 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p
             }
 
             av_frame_copy_props(qsv_frame->frame, picref);
-            av_frame_free(&picref);
         } else
             qsv_frame->frame = av_frame_clone(picref);
 



More information about the ffmpeg-cvslog mailing list