After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657049 - textoverlay: buffer leaks
textoverlay: buffer leaks
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.32
Other Linux
: Normal normal
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-22 02:37 UTC by bcxa.sz
Modified: 2011-08-23 07:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
textoverlay: fix text buffer leak (1.06 KB, patch)
2011-08-22 08:09 UTC, Vincent Penquerc'h
committed Details | Review

Description bcxa.sz 2011-08-22 02:37:43 UTC
I checked this potential bug is not only in 0.10.32, but also 0.10.34 and 0.11.0.

Hi Developers,

I found one potential bug in gst_text_overlay_text_chain() in
ext/pango/gsttextoverlay.c (as the mail title).

If looked at this piece of code,
 ...
 if (G_LIKELY (GST_BUFFER_TIMESTAMP_IS_VALID (buffer))) {

   ...
   in_seg = gst_segment_clip (&overlay->text_segment, GST_FORMAT_TIME,
       GST_BUFFER_TIMESTAMP (buffer), stop, &clip_start, &clip_stop);
 } else {
   in_seg = TRUE;
 }

if (in_seg) {
 ...
 }
 GST_OBJECT_UNLOCK (overlay); // NOTE the buffer will not be unref in
case of in_seg == FALSE

beach:

 return ret;
}

If the in_seg == TRUE, the text buffer will render the text and push
into the queue.

But if in_seg = FALSE, the text buffer will not be unrefed. So I think
this is the bug and should add code to handle unref the buffer in case
of in_seg == FALSE.

Or it will have memory leakage.

Let me know if I am wrong.
Comment 1 Vincent Penquerc'h 2011-08-22 08:09:33 UTC
Good catch, a few other paths were also leaking the buffer.
Comment 2 Vincent Penquerc'h 2011-08-22 08:09:53 UTC
Created attachment 194347 [details] [review]
textoverlay: fix text buffer leak

Reported by bcxa.sz@gmail.com.
Comment 3 Tim-Philipp Müller 2011-08-22 09:50:59 UTC
Thanks:

 commit 7d3858a14da8e3b9ec6a36e9c2e5c627e77b9df6
 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
 Date:   Mon Aug 22 09:06:53 2011 +0100

    textoverlay: fix text buffer leak
    
    Make sure to always unref the input text buffer.
    
    Reported by bcxa.sz@gmail.com.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657049
Comment 4 bcxa.sz 2011-08-23 01:58:41 UTC
Thanks for the quick fix. Please let me know which official release package will have this fix. 0.11.0?
Comment 5 Tim-Philipp Müller 2011-08-23 07:52:21 UTC
> which official release package will have this fix. 0.11.0?

0.10.36