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 704921 - matroskademux: memory leak in check_subtitle_buffer
matroskademux: memory leak in check_subtitle_buffer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal major
: 1.1.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-26 09:43 UTC by Matej Knopp
Modified: 2013-07-26 15:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (721 bytes, patch)
2013-07-26 09:43 UTC, Matej Knopp
needs-work Details | Review
Updated patch (1.74 KB, patch)
2013-07-26 14:03 UTC, Matej Knopp
committed Details | Review

Description Matej Knopp 2013-07-26 09:43:19 UTC
Created attachment 250187 [details] [review]
Patch

gst_matroska_demux_check_subtitle_buffer sometimes doesn't unmap the memory. Given that the buffer is a region in a 64kilobyte buffer this can lead to leaking quite a lot of memory.
Comment 1 Sebastian Dröge (slomo) 2013-07-26 09:55:34 UTC
Review of attachment 250187 [details] [review]:

::: gst/matroska/matroska-demux.c
@@ +3021,2 @@
       *buf = newbuf;
+      gst_buffer_map (*buf, &map, GST_MAP_READ);

Instead of useless mapping, maybe remember in a "needs_unmap" boolean if you need to unmap. Also the unmapping should IMHO happen before all the copy_into() calls above
Comment 2 Matej Knopp 2013-07-26 14:03:44 UTC
Created attachment 250203 [details] [review]
Updated patch
Comment 3 Sebastian Dröge (slomo) 2013-07-26 15:11:48 UTC
commit 7335b81c4770595b3dcd02dd247c7d3b658229a0
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Fri Jul 26 16:02:01 2013 +0200

    matroskademux: fix memory leak in check_subtitle_buffer
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704921