[FFmpeg-devel] [PATCH 1/3] lavc/qsvenc: fix check to avoid segfault
haihao.xiang at intel.com
haihao.xiang at intel.com
Tue Oct 18 07:59:23 EEST 2022
From: Haihao Xiang <haihao.xiang at intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>
---
libavcodec/qsvenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 15e6936a65..19fe6e59a2 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -2093,8 +2093,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 ||
--
2.25.1
More information about the ffmpeg-devel
mailing list