mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
basetextoverlay: fix buffer leak in chain function
If we don't consume the buffer by passing its reference to overlay->text_buffer then we need to unref it. Fix a leak with validate.file.playback.fast_forward.test5_mkv when running inside Valgrind. https://bugzilla.gnome.org/show_bug.cgi?id=747602
This commit is contained in:
parent
d668b511d1
commit
e9a6cafa13
1 changed files with 5 additions and 1 deletions
|
@ -2273,7 +2273,9 @@ gst_base_text_overlay_text_chain (GstPad * pad, GstObject * parent,
|
|||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
|
||||
overlay->text_segment.position = clip_start;
|
||||
|
||||
overlay->text_buffer = buffer;
|
||||
overlay->text_buffer = buffer; /* pass ownership of @buffer */
|
||||
buffer = NULL;
|
||||
|
||||
/* That's a new text buffer we need to render */
|
||||
overlay->need_render = TRUE;
|
||||
|
||||
|
@ -2284,6 +2286,8 @@ gst_base_text_overlay_text_chain (GstPad * pad, GstObject * parent,
|
|||
GST_BASE_TEXT_OVERLAY_UNLOCK (overlay);
|
||||
|
||||
beach:
|
||||
if (buffer)
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue