[FFmpeg-cvslog] qsv: add return value check for MFXQueryIMPL
Tong Wu
git at videolan.org
Mon Feb 28 08:40:15 EET 2022
ffmpeg | branch: master | Tong Wu <tong1.wu-at-intel.com at ffmpeg.org> | Thu Feb 24 10:27:39 2022 +0800| [d05ca3d779aed2df3d1cd74d1d295eb3729b7bf2] | committer: Haihao Xiang
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 <tong1.wu at intel.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d05ca3d779aed2df3d1cd74d1d295eb3729b7bf2
---
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:
More information about the ffmpeg-cvslog
mailing list