[OE-core] [pyro][PATCH 6/6] gstreamer1.0-plugins-bad: Fix memory leak when use a GValue in glupload

Yuqing Zhu carol.zhu at nxp.com
Tue May 23 14:08:08 UTC 2017


This memory leak issue is common.

GValue "targets" should be unset after set to caps
to avoid memory leak.

Signed-off-by: Yuqing Zhu <carol.zhu at nxp.com>
---
 ...-glupload-fix-memory-leak-when-use-a-GVal.patch | 29 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb   |  1 +
 2 files changed, 30 insertions(+)
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-glupload-fix-memory-leak-when-use-a-GVal.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-glupload-fix-memory-leak-when-use-a-GVal.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-glupload-fix-memory-leak-when-use-a-GVal.patch
new file mode 100755
index 0000000..fa98405
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-glupload-fix-memory-leak-when-use-a-GVal.patch
@@ -0,0 +1,29 @@
+From a3988d464c89742cfe8fbbd570eef5e6ab5159ba Mon Sep 17 00:00:00 2001
+From: Haihua Hu <jared.hu at nxp.com>
+Date: Fri, 28 Apr 2017 10:21:31 +0800
+Subject: [PATCH 1/2] glupload: fix memory leak when use a GValue
+
+GValue "targets" should be unset after set to caps
+to avoid memory leak
+
+Upstream-Status: Backport [1.10.5]
+https://bugzilla.gnome.org/show_bug.cgi?id=781876
+---
+ gst-libs/gst/gl/gstglupload.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c
+index f33a696..3ef3b19 100644
+--- a/gst-libs/gst/gl/gstglupload.c
++++ b/gst-libs/gst/gl/gstglupload.c
+@@ -179,6 +179,7 @@ _caps_intersect_texture_target (GstCaps * caps, GstGLTextureTarget target_mask)
+   target = gst_caps_copy (caps);
+   gst_gl_value_set_texture_target_from_mask (&targets, target_mask);
+   gst_caps_set_value (target, "texture-target", &targets);
++  g_value_unset(&targets);
+ 
+   ret = gst_caps_intersect_full (caps, target, GST_CAPS_INTERSECT_FIRST);
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
index 91e1a51..68f78ea 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
@@ -23,6 +23,7 @@ SRC_URI = " \
     file://0004-player-Add-get-track-number-media-info-API.patch \
     file://0005-player-Add-overlayvideorenderer-video-sink.patch \
     file://0006-gst-player-fix-gst-player-failed-to-load-external-su.patch \
+    file://0007-glupload-fix-memory-leak-when-use-a-GVal.patch \
 "
 SRC_URI[md5sum] = "2757103e57a096a1a05b3ab85b8381af"
 SRC_URI[sha256sum] = "23ddae506b3a223b94869a0d3eea3e9a12e847f94d2d0e0b97102ce13ecd6966"
-- 
1.9.1




More information about the Openembedded-core mailing list