From a0a2ccd55d2038867b0677c31f70632a69f6e9e3 Mon Sep 17 00:00:00 2001 From: Tong Wu Date: Thu, 24 Feb 2022 10:27:40 +0800 Subject: [PATCH] qsvenc: avoid dereferencing the null pointer The variable AVFrame *frame could be a null pointer, now add a null pointer check to avoid dereferencing the null pointer. Signed-off-by: Tong Wu --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 49f61ae6bb..9b71487666 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1736,7 +1736,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, goto free; } - if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame->interlaced_frame) + if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame && frame->interlaced_frame) print_interlace_msg(avctx, q); ret = 0;