Message ID | 20220224022740.58216-1-tong1.wu@intel.com |
---|---|
State | Accepted |
Commit | d05ca3d779aed2df3d1cd74d1d295eb3729b7bf2 |
Headers | show |
Series | [FFmpeg-devel] qsv: add return value check for MFXQueryIMPL | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_aarch64_jetson | success | Make finished |
andriy/make_fate_aarch64_jetson | success | Make fate finished |
andriy/make_armv7_RPi4 | success | Make finished |
andriy/make_fate_armv7_RPi4 | success | Make fate finished |
On Thu, 2022-02-24 at 10:27 +0800, Tong Wu wrote: > add a return value check for function MFXQueryIMPL to handle the error > message. > > Signed-off-by: Tong Wu <tong1.wu@intel.com> > --- > libavcodec/qsv.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c > index 1a432dbd82..18f34f05fd 100644 > --- a/libavcodec/qsv.c > +++ b/libavcodec/qsv.c > @@ -408,7 +408,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: LGTM, applied -Haihao
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 1a432dbd82..18f34f05fd 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -408,7 +408,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:
add a return value check for function MFXQueryIMPL to handle the error message. Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/qsv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)