mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 02:30:35 +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/5453>
This commit is contained in:
parent
019430949c
commit
b5ca7eba4e
1 changed files with 2 additions and 1 deletions
|
@ -1038,7 +1038,8 @@ gst_gl_filter_transform (GstBaseTransform * bt, GstBuffer * inbuf,
|
|||
* buffer meta to hold one reference of inbuf, this can avoid this
|
||||
* 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue