mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
kmssink: fix memory leak on failing allowed caps
When drm does not find any format, the allowed_caps is empty one and need to be unref by the caller. Fix #1268
This commit is contained in:
parent
63940feaaf
commit
040077dbc8
1 changed files with 7 additions and 1 deletions
|
@ -568,12 +568,18 @@ ensure_allowed_caps (GstKMSSink * self, drmModeConnector * conn,
|
|||
out_caps = gst_caps_merge (out_caps, gst_caps_simplify (tmp_caps));
|
||||
}
|
||||
|
||||
if (gst_caps_is_empty (out_caps)) {
|
||||
GST_DEBUG_OBJECT (self, "allowed caps is empty");
|
||||
gst_caps_unref (out_caps);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
self->allowed_caps = gst_caps_simplify (out_caps);
|
||||
|
||||
GST_DEBUG_OBJECT (self, "allowed caps = %" GST_PTR_FORMAT,
|
||||
self->allowed_caps);
|
||||
|
||||
return (self->allowed_caps && !gst_caps_is_empty (self->allowed_caps));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue