[FFmpeg-cvslog] qsvenc: avoid dereferencing the null pointer

Tong Wu git at videolan.org
Mon Feb 28 08:40:17 EET 2022


ffmpeg | branch: master | Tong Wu <tong1.wu-at-intel.com at ffmpeg.org> | Thu Feb 24 10:27:40 2022 +0800| [a0a2ccd55d2038867b0677c31f70632a69f6e9e3] | committer: Haihao Xiang

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 at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a0a2ccd55d2038867b0677c31f70632a69f6e9e3
---

 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;



More information about the ffmpeg-cvslog mailing list