From aae382bcc6fe579a3df3315024016d2708423624 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Mon, 13 Dec 2010 16:23:37 +0100 Subject: [PATCH] jpegparse: avoid leaking tag event --- gst/jpegformat/gstjpegparse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c index c1c65391be..5c54776a02 100644 --- a/gst/jpegformat/gstjpegparse.c +++ b/gst/jpegformat/gstjpegparse.c @@ -934,15 +934,17 @@ gst_jpeg_parse_sink_event (GstPad * pad, GstEvent * event) parse->priv->new_segment = TRUE; break; case GST_EVENT_TAG:{ - GstTagList *taglist = NULL; - gst_event_parse_tag (event, &taglist); if (!parse->priv->new_segment) res = gst_pad_event_default (pad, event); else { + GstTagList *taglist = NULL; + + gst_event_parse_tag (event, &taglist); /* Hold on to the tags till the srcpad caps are definitely set */ if (!parse->priv->tags) parse->priv->tags = gst_tag_list_new (); gst_tag_list_insert (parse->priv->tags, taglist, GST_TAG_MERGE_REPLACE); + gst_event_unref (event); } break; }