msdkdec: fix error handling in case of unsupported hardware

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
This commit is contained in:
Peter Seiderer 2019-04-06 21:44:35 +02:00 committed by Víctor Manuel Jáquez Leal
parent e766aaf2b1
commit 670481bdeb

View 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);
}