]> git.sesse.net Git - ffmpeg/commitdiff
qsv: Error out if getting session handle failed in avfilter
authorZhong Li <zhong.li@intel.com>
Wed, 15 Aug 2018 09:39:33 +0000 (17:39 +0800)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 23 Aug 2018 06:22:34 +0000 (08:22 +0200)
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>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavfilter/qsvvpp.c
libavfilter/vf_deinterlace_qsv.c
libavfilter/vf_scale_qsv.c

index f704517aee10376323d9eab8cfc8958005476acb..75966b352d5e62c20961c0fe93750c1d857f1c13 100644 (file)
@@ -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) {
index bb26a4dbfef686e730e235acfb13d39a1de0074f..b659d424bef5694ae316f6afd0f954e50bdec430 100644 (file)
@@ -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);
index 381844cdc4a73e9658b9134e30f549393ff24f91..e9bfff867d891285951e8a0a871af9d3e5bdccb8 100644 (file)
@@ -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);