mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
v4l2object: Don't leak config structure
this fixes a leak of the config structure and take care of making sure caps can't reach ref 0 before we are done doing our check. CID 1212144
This commit is contained in:
parent
5284aca559
commit
e45b1fd9e6
1 changed files with 9 additions and 4 deletions
|
@ -2952,16 +2952,21 @@ gst_v4l2_object_set_crop (GstV4l2Object * obj)
|
|||
gboolean
|
||||
gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps)
|
||||
{
|
||||
GstStructure *s;
|
||||
GstStructure *config;
|
||||
GstCaps *oldcaps;
|
||||
gboolean ret;
|
||||
|
||||
if (!v4l2object->pool)
|
||||
return FALSE;
|
||||
|
||||
s = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (v4l2object->pool));
|
||||
gst_buffer_pool_config_get_params (s, &oldcaps, NULL, NULL, NULL);
|
||||
config = gst_buffer_pool_get_config (v4l2object->pool);
|
||||
gst_buffer_pool_config_get_params (config, &oldcaps, NULL, NULL, NULL);
|
||||
|
||||
return oldcaps && gst_caps_is_equal (caps, oldcaps);
|
||||
ret = oldcaps && gst_caps_is_equal (caps, oldcaps);
|
||||
|
||||
gst_structure_free (config);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
Loading…
Reference in a new issue