msdkdec: fix error handling in case of unsupported hardware
authorPeter Seiderer <ps.report@gmx.net>
Sat, 6 Apr 2019 19:44:35 +0000 (21:44 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 10 Apr 2019 15:54:31 +0000 (15:54 +0000)
Check the return value of gst_msdk_context_ensure_context and
abort in case of failure.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/945

sys/msdk/gstmsdkdec.c

index 19b6b57..0870cba 100644 (file)
@@ -675,8 +675,9 @@ gst_msdkdec_start (GstVideoDecoder * decoder)
       gst_msdk_context_add_job_type (thiz->context, GST_MSDK_JOB_DECODER);
     }
   } else {
-    gst_msdk_context_ensure_context (GST_ELEMENT_CAST (thiz), thiz->hardware,
-        GST_MSDK_JOB_DECODER);
+    if (!gst_msdk_context_ensure_context (GST_ELEMENT_CAST (thiz),
+            thiz->hardware, GST_MSDK_JOB_DECODER))
+      return FALSE;
     GST_INFO_OBJECT (thiz, "Creating new context %" GST_PTR_FORMAT,
         thiz->context);
   }