From fb842a3fdb7008937b3b7eff85492512e0e842b7 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 ba6ebcceea..15d8038b41 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;