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 755277 - rtptheoradepay: Memory leaks
rtptheoradepay: Memory leaks
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 1.6.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-19 23:28 UTC by Sebastian Rasmussen
Modified: 2015-09-20 08:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch to make rtpvorbis* and rtptheora* as identical as possible (5.06 KB, patch)
2015-09-19 23:30 UTC, Sebastian Rasmussen
committed Details | Review
Proposed patch plugging the memory leaks (3.61 KB, patch)
2015-09-19 23:30 UTC, Sebastian Rasmussen
committed Details | Review

Description Sebastian Rasmussen 2015-09-19 23:28:08 UTC
rtptheoradepay has a few memory leaks that are easy to spot once tests/examples/rtp/*rtpaux.c are tweaked to handle EOS and are run in valgrind.

When locating these memory leaks I noticed that theora and vorbis are implemented almost identically in rtppay/-depay so I started comparing them. The same memory leaks have already been addressed in 2009 in commit http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=06efeff5d979576a252e5dae57f46d6445b1df12

The attached patch series depend on the patch from https://bugzilla.gnome.org/show_bug.cgi?id=755265 and compiles, the unit tests look no worse than before and valgrind no longer complains about leaks when running the tweaked examples-code.
Comment 1 Sebastian Rasmussen 2015-09-19 23:30:02 UTC
Created attachment 311679 [details] [review]
Proposed patch to make rtpvorbis* and rtptheora* as identical as possible
Comment 2 Sebastian Rasmussen 2015-09-19 23:30:28 UTC
Created attachment 311680 [details] [review]
Proposed patch plugging the memory leaks
Comment 3 Sebastian Dröge (slomo) 2015-09-20 08:14:22 UTC
commit 905295ea34e441232171e462fb859f699e6a288f
Author: Sebastian Rasmussen <sebras@hotmail.com>
Date:   Sat Sep 19 17:02:18 2015 +0200

    rtptheoradepay: Fix memory leaks
    
    The same memory leaks were fixed in identical fashion for
    vorbisdepay in 06efeff5d979576a252e5dae57f46d6445b1df12 in 2009.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755277

commit 2d7bfc13141ad751e2de833b85efa11a2b8a52ef
Author: Sebastian Rasmussen <sebras@hotmail.com>
Date:   Sat Sep 19 17:04:07 2015 +0200

    rtp{vorbis,theora}{pay,depay}: Cosmetic cleanup
    
    * use g_list_free_full(), don't iterate elements maually when freeing
    * call gst_rtp_*_pay_clear_packet(), don't duplicate its code
    * use gst_buffer_unref() to clarify that it is buffers being released,
      instead of refering directly to gst_mini_object_unref()
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755277