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>
This commit is contained in:
Tong Wu 2022-02-24 10:27:40 +08:00 committed by Haihao Xiang
parent d05ca3d779
commit a0a2ccd55d
1 changed files with 1 additions and 1 deletions

View File

@ -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;