mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
glfilter: Only add parent meta if inbuf != outbuf
This was causing a memory leak in cases like `gltestsrc ! gltransformation scale-x=0.5 ! glimagesink`. Parent meta was being added in assumption that those buffers are different, which was not the case here, creating a reference loop and never freeing the buffer. Co-authored-by: Matthew Waters <matthew@centricular.com> Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5445>
This commit is contained in:
parent
3536b7f3a6
commit
64a58c37ac
1 changed files with 2 additions and 1 deletions
|
@ -1039,7 +1039,8 @@ gst_gl_filter_transform (GstBaseTransform * bt, GstBuffer * inbuf,
|
||||||
* buffer meta to hold one reference of inbuf, this can avoid this
|
* buffer meta to hold one reference of inbuf, this can avoid this
|
||||||
* buffer sync problem.
|
* buffer sync problem.
|
||||||
*/
|
*/
|
||||||
gst_buffer_add_parent_buffer_meta (outbuf, inbuf);
|
if (inbuf != outbuf)
|
||||||
|
gst_buffer_add_parent_buffer_meta (outbuf, inbuf);
|
||||||
|
|
||||||
return ret ? GST_FLOW_OK : GST_FLOW_ERROR;
|
return ret ? GST_FLOW_OK : GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue