va: gst_va_create_raw_caps_from_config() may return NULL.

This patch verifies if the function returns NULL in the caller.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2899>
This commit is contained in:
Víctor Manuel Jáquez Leal 2022-08-16 14:45:46 +02:00 committed by GStreamer Marge Bot
parent 45408db258
commit 0446e35a14
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -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);