summaryrefslogtreecommitdiff
path: root/libavcodec/qsvenc.c
diff options
context:
space:
mode:
authorTong Wu <tong1.wu-at-intel.com@ffmpeg.org>2022-02-24 10:27:40 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-02-28 12:41:40 +0800
commita0a2ccd55d2038867b0677c31f70632a69f6e9e3 (patch)
treee04f9b5da184bdc27b3996d5d1ac6515ad7574e2 /libavcodec/qsvenc.c
parentd05ca3d779aed2df3d1cd74d1d295eb3729b7bf2 (diff)
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 <tong1.wu@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r--libavcodec/qsvenc.c2
1 files changed, 1 insertions, 1 deletions
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;