From d31472fde750d3a592ef2232bfafe97dc34a9465 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 21 Apr 2015 15:27:57 +0200 Subject: [PATCH] oggdemux: fix event leaks gst_event_replace() takes its own reference on the event so we should drop ours after creating and storing an event using it. This fix leaks which can be reproduced using the validate.http.media_check.vorbis_theora_1_ogg scenario. https://bugzilla.gnome.org/show_bug.cgi?id=748247 --- ext/ogg/gstoggdemux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index c027b43788..c61f374660 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1525,6 +1525,7 @@ gst_ogg_demux_seek_back_after_push_duration_check_unlock (GstOggDemux * ogg) GST_SEEK_TYPE_SET, 1, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE); } gst_event_replace (&ogg->seek_event, event); + gst_event_unref (event); GST_PUSH_UNLOCK (ogg); g_mutex_lock (&ogg->seek_event_mutex); g_cond_broadcast (&ogg->seek_event_cond); @@ -1855,6 +1856,7 @@ gst_ogg_pad_handle_push_mode_state (GstOggPad * pad, ogg_page * page) gst_event_set_seqnum (sevent, ogg->seqnum); gst_event_replace (&ogg->seek_event, sevent); + gst_event_unref (sevent); GST_PUSH_UNLOCK (ogg); g_mutex_lock (&ogg->seek_event_mutex); g_cond_broadcast (&ogg->seek_event_cond); @@ -3646,6 +3648,7 @@ gst_ogg_demux_get_duration_push (GstOggDemux * ogg, int flags) sevent = gst_event_new_seek (1.0, GST_FORMAT_BYTES, flags, GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_SET, ogg->push_byte_length - 1); gst_event_replace (&ogg->seek_event, sevent); + gst_event_unref (sevent); g_mutex_lock (&ogg->seek_event_mutex); g_cond_broadcast (&ogg->seek_event_cond); g_mutex_unlock (&ogg->seek_event_mutex); @@ -3856,6 +3859,7 @@ gst_ogg_demux_perform_seek_push (GstOggDemux * ogg, GstEvent * event) gst_event_set_seqnum (sevent, gst_event_get_seqnum (event)); gst_event_replace (&ogg->seek_event, sevent); + gst_event_unref (sevent); GST_PUSH_UNLOCK (ogg); g_mutex_lock (&ogg->seek_event_mutex); g_cond_broadcast (&ogg->seek_event_cond);