mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
validate:ssim: Avoid segfaults trying to attach pads without a template
This commit is contained in:
parent
d654a4049b
commit
78f2026467
1 changed files with 10 additions and 2 deletions
|
@ -306,13 +306,21 @@ _can_attach (GstValidateOverride * override, GstValidateMonitor * monitor)
|
||||||
pad = GST_PAD (gst_validate_monitor_get_target (monitor));
|
pad = GST_PAD (gst_validate_monitor_get_target (monitor));
|
||||||
element = gst_validate_monitor_get_element (monitor);
|
element = gst_validate_monitor_get_element (monitor);
|
||||||
if ((gst_validate_element_has_klass (element, "Converter") ||
|
if ((gst_validate_element_has_klass (element, "Converter") ||
|
||||||
gst_validate_element_has_klass (element, "Filter")) &&
|
gst_validate_element_has_klass (element, "Filter") ||
|
||||||
|
gst_validate_element_has_klass (element, "Decoder")) &&
|
||||||
GST_PAD_IS_SINK (pad)) {
|
GST_PAD_IS_SINK (pad)) {
|
||||||
GST_INFO_OBJECT (override, "Not attaching on filter sinkpads");
|
GST_INFO_OBJECT (override, "Not attaching on filter or decoder sinkpads");
|
||||||
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!GST_PAD_PAD_TEMPLATE (pad)) {
|
||||||
|
GST_INFO_OBJECT (pad,
|
||||||
|
"Doesn't have template, can't use it %" GST_PTR_FORMAT,
|
||||||
|
gst_pad_query_caps (pad, NULL));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
template_caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
|
template_caps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
|
||||||
for (i = 0; i < gst_caps_get_size (template_caps); i++) {
|
for (i = 0; i < gst_caps_get_size (template_caps); i++) {
|
||||||
structure = gst_caps_get_structure (template_caps, i);
|
structure = gst_caps_get_structure (template_caps, i);
|
||||||
|
|
Loading…
Reference in a new issue