Commit 151b7264 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

utils: Fix caps leaks in gst_element_factory_can_accept_{any,all}_caps_in_direction()

parent 0b6430f6
......@@ -1286,10 +1286,14 @@ gst_element_factory_can_accept_all_caps_in_direction (GstElementFactory *
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
if (template->direction == direction) {
if (gst_caps_is_always_compatible (caps,
gst_static_caps_get (&template->static_caps)))
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
if (gst_caps_is_always_compatible (caps, templcaps)) {
gst_caps_unref (templcaps);
return TRUE;
}
gst_caps_unref (templcaps);
}
templates = g_list_next (templates);
}
......@@ -1311,10 +1315,14 @@ gst_element_factory_can_accept_any_caps_in_direction (GstElementFactory *
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
if (template->direction == direction) {
if (gst_caps_can_intersect (caps,
gst_static_caps_get (&template->static_caps)))
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
if (gst_caps_can_intersect (caps, templcaps)) {
gst_caps_unref (templcaps);
return TRUE;
}
gst_caps_unref (templcaps);
}
templates = g_list_next (templates);
}
......
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