diff mbox series

[FFmpeg-devel] lavc/qsvenc: add NULL pointer check for frame before use

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
Related show


Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Fu, Linjie Jan. 21, 2020, 8:42 a.m. UTC
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

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


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) {