From e766aaf2b1c228657bf14bdf06cb4bdb911aeae1 Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Sat, 6 Apr 2019 21:29:58 +0200 Subject: [PATCH] msdkenc: 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 --- sys/msdk/gstmsdkenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/msdk/gstmsdkenc.c b/sys/msdk/gstmsdkenc.c index 8f1bfa8..d05e168 100644 --- a/sys/msdk/gstmsdkenc.c +++ b/sys/msdk/gstmsdkenc.c @@ -1422,9 +1422,9 @@ gst_msdkenc_start (GstVideoEncoder * encoder) gst_msdk_context_add_job_type (thiz->context, GST_MSDK_JOB_ENCODER); } } else { - gst_msdk_context_ensure_context (GST_ELEMENT_CAST (thiz), thiz->hardware, - GST_MSDK_JOB_ENCODER); - + if (!gst_msdk_context_ensure_context (GST_ELEMENT_CAST (thiz), + thiz->hardware, GST_MSDK_JOB_ENCODER)) + return FALSE; GST_INFO_OBJECT (thiz, "Creating new context %" GST_PTR_FORMAT, thiz->context); } -- 2.7.4