From 53884bdcecfb86d861e3d16941d70a34f53daf7a Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Wed, 26 Jun 2019 03:39:54 -0400 Subject: [PATCH] audiodecoder: Fix leak on failed audio gaps If we fail to process the gap event we need to unref the event or we end up with a leak. --- gst-libs/gst/audio/gstaudiodecoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index ba6ebccee..15d8038b4 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -2225,6 +2225,7 @@ gst_audio_decoder_handle_gap (GstAudioDecoder * dec, GstEvent * event) GST_AUDIO_DECODER_STREAM_UNLOCK (dec); GST_ELEMENT_ERROR (dec, STREAM, FORMAT, (NULL), ("Decoder output not negotiated before GAP event.")); + gst_event_unref (event); return FALSE; } needs_reconfigure = TRUE; @@ -2273,6 +2274,7 @@ gst_audio_decoder_handle_gap (GstAudioDecoder * dec, GstEvent * event) ret = gst_audio_decoder_push_event (dec, event); } else { ret = FALSE; + gst_event_unref (event); } } return ret; -- 2.34.1