[1/3] lavf/qsv: return an error if getting session handle failed

Message ID 1534325975-3005-1-git-send-email-zhong.li@intel.com
State New
Headers show
Series
  • [1/3] lavf/qsv: return an error if getting session handle failed
Related show

Commit Message

Li, Zhong Aug. 15, 2018, 9:39 a.m.
Solve some issues found by an automated code scansion.
Suppress the complain "variables 'handle' is used but maybe
uninitialized".

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavfilter/qsvvpp.c             | 5 +++++
 libavfilter/vf_deinterlace_qsv.c | 5 +++++
 libavfilter/vf_scale_qsv.c       | 5 +++++
 3 files changed, 15 insertions(+)

Comments

Luca Barbato Aug. 16, 2018, 11:17 a.m. | #1
On 15/08/2018 11:39, Zhong Li wrote:
> Solve some issues found by an automated code scansion.
> Suppress the complain "variables 'handle' is used but maybe
> uninitialized".
> 
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
>  libavfilter/qsvvpp.c             | 5 +++++
>  libavfilter/vf_deinterlace_qsv.c | 5 +++++
>  libavfilter/vf_scale_qsv.c       | 5 +++++
>  3 files changed, 15 insertions(+)

The set looks good.

lu
Li, Zhong Aug. 21, 2018, 7:15 a.m. | #2
> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of Luca
> Barbato
> Sent: Thursday, August 16, 2018 7:18 PM
> To: libav-devel@libav.org
> Subject: Re: [libav-devel] [PATCH 1/3] lavf/qsv: return an error if getting
> session handle failed
> 
> On 15/08/2018 11:39, Zhong Li wrote:
> > Solve some issues found by an automated code scansion.
> > Suppress the complain "variables 'handle' is used but maybe
> > uninitialized".
> >
> > Signed-off-by: Zhong Li <zhong.li@intel.com>
> > ---
> >  libavfilter/qsvvpp.c             | 5 +++++
> >  libavfilter/vf_deinterlace_qsv.c | 5 +++++
> >  libavfilter/vf_scale_qsv.c       | 5 +++++
> >  3 files changed, 15 insertions(+)
> 
> The set looks good.
> 
> lu

Thank you. Luca. Will be applied?
Luca Barbato Aug. 22, 2018, 11:20 a.m. | #3
On 21/08/2018 09:15, Li, Zhong wrote:
> Thank you. Luca. Will be applied?

I was waiting for Maxym's feedback, but sure, it can.

I'll push it this evening.

lu
Maxym Dmytrychenko Aug. 22, 2018, 2:50 p.m. | #4
On Wed, Aug 22, 2018 at 1:21 PM Luca Barbato <lu_zero@gentoo.org> wrote:

> On 21/08/2018 09:15, Li, Zhong wrote:
> > Thank you. Luca. Will be applied?
>
> I was waiting for Maxym's feedback, but sure, it can.
>
> I'll push it this evening.
>
> lu
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel


was busy here but just fine!

thanks

regards
Max
Li, Zhong Aug. 23, 2018, 9:44 a.m. | #5
> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of
> Maxym Dmytrychenko
> Sent: Wednesday, August 22, 2018 10:50 PM
> To: libav development <libav-devel@libav.org>
> Subject: Re: [libav-devel] [PATCH 1/3] lavf/qsv: return an error if getting
> session handle failed
> 
> On Wed, Aug 22, 2018 at 1:21 PM Luca Barbato <lu_zero@gentoo.org>
> wrote:
> 
> > On 21/08/2018 09:15, Li, Zhong wrote:
> > > Thank you. Luca. Will be applied?
> >
> > I was waiting for Maxym's feedback, but sure, it can.
> >
> > I'll push it this evening.
> >
> > lu
> > _______________________________________________
> > libav-devel mailing list
> > libav-devel@libav.org
> > https://lists.libav.org/mailman/listinfo/libav-devel
> 
> 
> was busy here but just fine!
> 
> thanks
> 
> regards
> Max

I see patch set merged. Thank you Luca/Maxym.

Patch

diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index f704517..75966b3 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -503,6 +503,11 @@  static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
         }
     }
 
+    if (ret != MFX_ERR_NONE) {
+        av_log(avctx, AV_LOG_ERROR, "Error getting the session handle\n");
+        return AVERROR_UNKNOWN;
+    }
+
     /* create a "slave" session with those same properties, to be used for vpp */
     ret = MFXInit(impl, &ver, &s->session);
     if (ret != MFX_ERR_NONE) {
diff --git a/libavfilter/vf_deinterlace_qsv.c b/libavfilter/vf_deinterlace_qsv.c
index bb26a4d..b659d42 100644
--- a/libavfilter/vf_deinterlace_qsv.c
+++ b/libavfilter/vf_deinterlace_qsv.c
@@ -201,6 +201,11 @@  static int init_out_session(AVFilterContext *ctx)
         }
     }
 
+    if (err != MFX_ERR_NONE) {
+        av_log(ctx, AV_LOG_ERROR, "Error getting the session handle\n");
+        return AVERROR_UNKNOWN;
+    }
+
     /* create a "slave" session with those same properties, to be used for
      * actual deinterlacing */
     err = MFXInit(impl, &ver, &s->session);
diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c
index 381844c..e9bfff8 100644
--- a/libavfilter/vf_scale_qsv.c
+++ b/libavfilter/vf_scale_qsv.c
@@ -300,6 +300,11 @@  static int init_out_session(AVFilterContext *ctx)
         }
     }
 
+    if (err != MFX_ERR_NONE) {
+        av_log(ctx, AV_LOG_ERROR, "Error getting the session handle\n");
+        return AVERROR_UNKNOWN;
+    }
+
     /* create a "slave" session with those same properties, to be used for
      * actual scaling */
     err = MFXInit(impl, &ver, &s->session);