From d05ca3d779aed2df3d1cd74d1d295eb3729b7bf2 Mon Sep 17 00:00:00 2001 From: Tong Wu Date: Thu, 24 Feb 2022 10:27:39 +0800 Subject: [PATCH] qsv: add return value check for MFXQueryIMPL add a return value check for function MFXQueryIMPL to handle the error message. Signed-off-by: Tong Wu --- libavcodec/qsv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index b75877e698..67d0e3934a 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -424,7 +424,10 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, return ret; } - MFXQueryIMPL(qs->session, &impl); + ret = MFXQueryIMPL(qs->session, &impl); + if (ret != MFX_ERR_NONE) + return ff_qsv_print_error(avctx, ret, + "Error querying the session attributes"); switch (MFX_IMPL_BASETYPE(impl)) { case MFX_IMPL_SOFTWARE: