diff --git a/subprojects/gst-plugins-bad/ext/openh264/gstopenh264dec.cpp b/subprojects/gst-plugins-bad/ext/openh264/gstopenh264dec.cpp index 6d3464628f..77f2b8fe34 100644 --- a/subprojects/gst-plugins-bad/ext/openh264/gstopenh264dec.cpp +++ b/subprojects/gst-plugins-bad/ext/openh264/gstopenh264dec.cpp @@ -159,7 +159,12 @@ gst_openh264dec_start (GstVideoDecoder * decoder) WelsDestroyDecoder (openh264dec->decoder); openh264dec->decoder = NULL; } - WelsCreateDecoder (&(openh264dec->decoder)); + + if (WelsCreateDecoder (&(openh264dec->decoder)) != 0) { + GST_ELEMENT_ERROR (openh264dec, LIBRARY, INIT, (NULL), + ("Failed to create OpenH264 decoder.")); + return FALSE; + } #ifndef GST_DISABLE_GST_DEBUG { diff --git a/subprojects/gst-plugins-bad/ext/openh264/gstopenh264enc.cpp b/subprojects/gst-plugins-bad/ext/openh264/gstopenh264enc.cpp index 00ad6b1d65..6b54b1584f 100644 --- a/subprojects/gst-plugins-bad/ext/openh264/gstopenh264enc.cpp +++ b/subprojects/gst-plugins-bad/ext/openh264/gstopenh264enc.cpp @@ -759,7 +759,13 @@ gst_openh264enc_set_format (GstVideoEncoder * encoder, WelsDestroySVCEncoder (openh264enc->encoder); openh264enc->encoder = NULL; } - WelsCreateSVCEncoder (&openh264enc->encoder); + + if (WelsCreateSVCEncoder (&openh264enc->encoder) != 0) { + GST_ELEMENT_ERROR (openh264enc, LIBRARY, INIT, (NULL), + ("Failed to create OpenH264 encoder.")); + return FALSE; + } + unsigned int uiTraceLevel = WELS_LOG_ERROR; openh264enc->encoder->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);