[FFmpeg-cvslog] lavc/qsvenc: fix check to avoid segfault

Haihao Xiang git at videolan.org
Tue Oct 25 04:20:25 EEST 2022


ffmpeg | branch: master | Haihao Xiang <haihao.xiang at intel.com> | Tue Oct 18 12:59:23 2022 +0800| [76965fa41177658444c334ebbe0ae11eafd8c796] | committer: Haihao Xiang

lavc/qsvenc: fix check to avoid segfault

Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>

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

 libavcodec/qsvenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 54b11c6ddd..993139eb33 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -2281,8 +2281,8 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
         pkt.bs->ExtParam = enc_buf;
     }
 
-    if (q->set_encode_ctrl_cb) {
-        q->set_encode_ctrl_cb(avctx, frame, &qsv_frame->enc_ctrl);
+    if (q->set_encode_ctrl_cb && enc_ctrl) {
+        q->set_encode_ctrl_cb(avctx, frame, enc_ctrl);
     }
 
     if ((avctx->codec_id == AV_CODEC_ID_H264 ||



More information about the ffmpeg-cvslog mailing list