mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
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:
parent
45408db258
commit
0446e35a14
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue