diff options
author | Matthew Waters <ystreet00@gmail.com> | 2014-02-23 10:36:57 +1100 |
---|---|---|
committer | Matthew Waters <ystreet00@gmail.com> | 2014-02-23 10:36:57 +1100 |
commit | 3fe63c9f5d17f08c6a48649e056f24baba32ced7 (patch) | |
tree | 2db8e9e1f3bcc9037a9ce760200c8eb597784b23 | |
parent | 7ab354d645251d1a51c967979c4a8f8bfdbdd93f (diff) |
mixer: fixup a memory leak of the context in the GLTextureUploadMeta path
gst_structure_get returns a reference to the object and we asked
for another with gst_object_replace.
https://bugzilla.gnome.org/show_bug.cgi?id=724816
-rw-r--r-- | gst-libs/gst/gl/gstglmixer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/gstglmixer.c b/gst-libs/gst/gl/gstglmixer.c index 04989ea..4f92ddc 100644 --- a/gst-libs/gst/gl/gstglmixer.c +++ b/gst-libs/gst/gl/gstglmixer.c @@ -1069,8 +1069,13 @@ gst_gl_mixer_decide_allocation (GstGLMixer * mix, GstQuery * query) gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params); if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext", - GST_GL_TYPE_CONTEXT, &context, NULL) && context) - gst_object_replace ((GstObject **) & mix->context, (GstObject *) context); + GST_GL_TYPE_CONTEXT, &context, NULL) && context) { + GstGLContext *old = mix->context; + + mix->context = context; + if (old) + gst_object_unref (old); + } } if (!mix->context) { |