summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-12-01 17:38:33 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-12-01 17:38:33 +0200
commit7d6cf17498625ef7dd3c3af6e3d789ff51465894 (patch)
treec1fda063021e62c2d7faab2393c216b76fbb573d
parentd3bc50bc8f9a24611ddf67c1b1e92cd6977851c0 (diff)
matroskademux: Fix memory leak when parsing attachments
gst_tag_image_data_to_image_sample() does not take ownership of the passed memory, so don't set it to NULL to allow us to free it later. https://bugzilla.gnome.org/show_bug.cgi?id=775472
-rw-r--r--gst/matroska/matroska-read-common.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gst/matroska/matroska-read-common.c b/gst/matroska/matroska-read-common.c
index 410384863..39bc2dbe4 100644
--- a/gst/matroska/matroska-read-common.c
+++ b/gst/matroska/matroska-read-common.c
@@ -625,10 +625,9 @@ gst_matroska_read_common_parse_attached_file (GstMatroskaReadCommon * common,
tagsample =
gst_tag_image_data_to_image_sample (data, datalen, image_type);
- if (!tagsample)
+ if (!tagsample) {
image_type = GST_TAG_IMAGE_TYPE_NONE;
- else {
- data = NULL;
+ } else {
tagbuffer = gst_buffer_ref (gst_sample_get_buffer (tagsample));
caps = gst_caps_ref (gst_sample_get_caps (tagsample));
info = gst_structure_copy (gst_sample_get_info (tagsample));