diff --git a/subprojects/gst-plugins-bad/sys/va/gstvadecoder.c b/subprojects/gst-plugins-bad/sys/va/gstvadecoder.c index 8948dd3e62..29177595a5 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvadecoder.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvadecoder.c @@ -415,6 +415,10 @@ gst_va_decoder_get_srcpad_caps (GstVaDecoder * self) if (gst_va_decoder_is_open (self)) { srcpad_caps = gst_va_create_raw_caps_from_config (self->display, self->config); + if (!srcpad_caps) { + GST_WARNING_OBJECT (self, "Invalid configuration caps"); + return NULL; + } gst_caps_replace (&self->srcpad_caps, srcpad_caps); gst_caps_unref (srcpad_caps); diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c index 19d96c138c..e5b7afec81 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c @@ -898,6 +898,10 @@ gst_va_encoder_get_sinkpad_caps (GstVaEncoder * self) if (gst_va_encoder_is_open (self)) { sinkpad_caps = gst_va_create_raw_caps_from_config (self->display, self->config); + if (!sinkpad_caps) { + GST_WARNING_OBJECT (self, "Invalid configuration caps"); + return NULL; + } gst_caps_replace (&self->sinkpad_caps, sinkpad_caps); gst_caps_unref (sinkpad_caps);