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 752404 - realmedia: fix leaks while playing real media files
realmedia: fix leaks while playing real media files
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-15 07:24 UTC by Vineeth
Modified: 2015-08-16 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix adapter leak (1.15 KB, patch)
2015-07-15 07:25 UTC, Vineeth
none Details | Review
fix memory leaks (1.86 KB, patch)
2015-07-16 00:31 UTC, Vineeth
none Details | Review
rmdemux: fix tag leak (803 bytes, patch)
2015-07-16 00:51 UTC, Vineeth
committed Details | Review
avviddec: fix slice_offset memory leak (1.02 KB, patch)
2015-07-16 00:52 UTC, Vineeth
none Details | Review
rmdemux: fix memory leaks during error conditions (2.65 KB, patch)
2015-07-16 09:18 UTC, Vineeth
committed Details | Review
avviddec: fix slice_offset memory leak (1.02 KB, patch)
2015-07-16 09:18 UTC, Vineeth
committed Details | Review
check if tags are present before appending and unref (1.24 KB, patch)
2015-07-21 03:46 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-07-15 07:24:18 UTC
during error conditions, stream->adapter is not being freed
Comment 1 Vineeth 2015-07-15 07:25:08 UTC
Created attachment 307448 [details] [review]
fix adapter leak
Comment 2 Tim-Philipp Müller 2015-07-15 08:40:43 UTC
Comment on attachment 307448 [details] [review]
fix adapter leak

Not wrong, but looks incomplete. Might there not be other things to free as well, like pending tags, the pad etc?
Comment 3 Vineeth 2015-07-16 00:31:09 UTC
Created attachment 307518 [details] [review]
fix memory leaks

pad needs to be freed only for audio subtype. Rest all needs to be freed for both cases.
Comment 4 Vineeth 2015-07-16 00:51:15 UTC
Created attachment 307519 [details] [review]
rmdemux: fix tag leak

this maybe merged with the other patch i guess. Since found this for a different media file, created a separate patch.
Comment 5 Vineeth 2015-07-16 00:52:05 UTC
Created attachment 307520 [details] [review]
avviddec: fix slice_offset memory leak

slice offset is being allocated for real movie files, but the same was not freed
Comment 6 Tim-Philipp Müller 2015-07-16 07:42:13 UTC
Comment on attachment 307518 [details] [review]
fix memory leaks

Perhaps that could be factored out into a gst_rmdemux_free_stream() function? (Since similar code is elsewhere already)
Comment 7 Tim-Philipp Müller 2015-07-16 08:13:57 UTC
Comment on attachment 307520 [details] [review]
avviddec: fix slice_offset memory leak

We allocated slice_offset with g_malloc(), so should free it with g_free() not av_free().
Comment 8 Vineeth 2015-07-16 09:18:23 UTC
Created attachment 307532 [details] [review]
rmdemux: fix memory leaks during error conditions

re-factored code as per review.
Comment 9 Vineeth 2015-07-16 09:18:59 UTC
Created attachment 307533 [details] [review]
avviddec: fix slice_offset memory leak

changed to g_free
Comment 10 Vineeth 2015-07-21 03:46:46 UTC
Created attachment 307792 [details] [review]
check if tags are present before appending and unref
Comment 11 Tim-Philipp Müller 2015-07-21 10:14:09 UTC
commit c12e5d1ad4c5279b2ec5c7d1aec88fea7e5f4f6a
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Tue Jul 21 11:13:27 2015 +0100

    rmdemux: mark tag list as global scope

commit 2be18749277ac142e1c4d7296d915c50002ab60e
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Tue Jul 21 11:10:04 2015 +0100

    rmdemux: fix taglist leak
    
    merge doesn't take ownership, so must unref the
    old tags if we do merge.

commit 868a885040f10f10782860031b7798d6f255a8b1
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Tue Jul 21 12:44:55 2015 +0900

    rmdemux: fix wrong unref when there are no tags
    
    Tags should be appended to pending tags and unref'ed only if tags
    are present. Else there is no need to append.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752404

commit 42dbce6d578469e2f7c6731c0d85d090341b2724
Author: Vineeth T M <vineeth.tm@samsung.com>
Date:   Thu Jul 16 18:11:37 2015 +0900

    rmdemux: fix memory leaks during error cases
    
    while adding stream, during error cases, only stream is
    being freed. Adapter, pad, tags, subpackets, index are not being
    freed resulting in memory leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752404
Comment 12 Tim-Philipp Müller 2015-07-21 10:24:09 UTC
Comment on attachment 307533 [details] [review]
avviddec: fix slice_offset memory leak

commit 7d3c7109acc2e153f02ecb3f56c530b916a9382e
Author: Vineeth T M <vineeth.tm@samsung.com>
Date:   Thu Jul 16 18:17:05 2015 +0900

    avviddec: fix slice_offset memory leak
    
    In case of real videos, slice_offset is being allocated,
    but the same is not being freed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752404