summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-11-02 12:01:03 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-11-02 12:02:23 +0000
commit3ecb114b61bc0f22445aac84d19db1c9a8678810 (patch)
treed6872633bce1a2ef34b96f24ef161997fa31033f
parent1c0b90661f91734ec88e9e2492d2a94a4a49a2c5 (diff)
tag: fix leak when parsing undefined EXIF tag into tag list
gst_buffer_set_data() does not set GST_BUFFER_MALLOCDATA, but the code assumes the buffer takes ownership of the memory allocated earlier.
-rw-r--r--gst-libs/gst/tag/gstexiftag.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c
index d73859b82..e72bf3a3a 100644
--- a/gst-libs/gst/tag/gstexiftag.c
+++ b/gst-libs/gst/tag/gstexiftag.c
@@ -1223,8 +1223,12 @@ parse_exif_undefined_tag (GstExifReader * reader, const GstExifTagMatch * tag,
tagtype = gst_tag_get_type (tag->gst_tag);
if (tagtype == GST_TYPE_BUFFER) {
- GstBuffer *buf = gst_buffer_new ();
- gst_buffer_set_data (buf, data, count);
+ GstBuffer *buf;
+
+ buf = gst_buffer_new ();
+ GST_BUFFER_DATA (buf) = data;
+ GST_BUFFER_MALLOCDATA (buf) = data;
+ GST_BUFFER_SIZE (buf) = count;
data = NULL;
gst_tag_list_add (reader->taglist, GST_TAG_MERGE_APPEND, tag->gst_tag,