vaapidecode: guard if no structure is available in caps

parent f88d18be
Pipeline #57278 passed with stages
in 25 minutes and 48 seconds
......@@ -325,6 +325,8 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
case GST_VAAPI_CAPS_FEATURE_DMABUF:
case GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE:{
GstStructure *structure = gst_caps_get_structure (state->caps, 0);
if (!structure)
break;
/* Remove chroma-site and colorimetry from src caps,
* which is unnecessary on downstream if using VASurface
......@@ -886,6 +888,9 @@ gst_vaapidecode_create (GstVaapiDecode * decode, GstCaps * caps)
GstStructure *const structure = gst_caps_get_structure (caps, 0);
const gchar *str = NULL;
if (!structure)
break;
if ((str = gst_structure_get_string (structure, "alignment"))) {
GstVaapiStreamAlignH264 alignment;
if (g_strcmp0 (str, "au") == 0)
......@@ -914,6 +919,9 @@ gst_vaapidecode_create (GstVaapiDecode * decode, GstCaps * caps)
GstStructure *const structure = gst_caps_get_structure (caps, 0);
const gchar *str = NULL;
if (!structure)
break;
if ((str = gst_structure_get_string (structure, "alignment"))) {
GstVaapiStreamAlignH265 alignment;
if (g_strcmp0 (str, "au") == 0)
......@@ -1249,6 +1257,8 @@ gst_vaapidecode_ensure_allowed_sinkpad_caps (GstVaapiDecode * decode)
if (!caps)
continue;
structure = gst_caps_get_structure (caps, 0);
if (!structure)
continue;
profile_name = gst_vaapi_profile_get_name (profile);
if (profile_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment