aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2022-10-18 12:59:23 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-10-25 08:49:48 +0800
commit76965fa41177658444c334ebbe0ae11eafd8c796 (patch)
treecb8ea50a64847fe90f66310ffd878dc644ec9278 /libavcodec
parentd7c3e52fbfca2656b361682dca38ae577a10e8b7 (diff)
downloadffmpeg-76965fa41177658444c334ebbe0ae11eafd8c796.tar.gz
lavc/qsvenc: fix check to avoid segfault
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/qsvenc.c4
1 files 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 ||