Message ID | 1579596139-24901-1-git-send-email-linjie.fu@intel.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] lavc/qsvenc: add NULL pointer check for frame before use | expand |
Context | Check | Description |
---|---|---|
andriy/ffmpeg-patchwork | success | Make fate finished |
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 9e41650..2dfe107 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1481,7 +1481,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, 0 : ff_qsv_print_error(avctx, ret, "Error during encoding"); } - 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); if (*sync) {
Null Frame would be sent to MSDK to flush the encoder, hence add a NULL check before using frame->interlaced_frame to prevent the potential crash, regardless of the return value of MFXVideoENCODE_EncodeFrameAsync(). Signed-off-by: Linjie Fu <linjie.fu@intel.com> --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)