From f9b49aef09cd0620f82c6cfd73f6df54d336ce85 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Wed, 6 Mar 2019 17:38:03 +0000 Subject: [PATCH] rtpulpfecdec: fix buffer leak when packet is recovered from storage Exposed by rtpulpfecdec_recovered_from_storage test. --- gst/rtp/gstrtpulpfecdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/rtp/gstrtpulpfecdec.c b/gst/rtp/gstrtpulpfecdec.c index da2937136e..59c09fb329 100644 --- a/gst/rtp/gstrtpulpfecdec.c +++ b/gst/rtp/gstrtpulpfecdec.c @@ -134,7 +134,7 @@ gst_rtp_ulpfec_dec_start (GstRtpUlpFecDec * self, GstBufferList * buflist, GST_LOG_RTP_PACKET (self, "rtp header (incoming)", &info->rtp); if (lost_seq == gst_rtp_buffer_get_seq (&info->rtp)) { - GST_DEBUG_OBJECT (self, "Received lost packet from from the storage"); + GST_DEBUG_OBJECT (self, "Received lost packet from the storage"); g_list_free (self->info_media); self->info_media = NULL; self->lost_packet_from_storage = TRUE; @@ -421,6 +421,9 @@ gst_rtp_ulpfec_dec_handle_packet_loss (GstRtpUlpFecDec * self, guint16 seqnum, sent_buffer = gst_buffer_copy_deep (recovered_buffer); + if (self->lost_packet_from_storage) + gst_buffer_unref (recovered_buffer); + gst_rtp_buffer_map (sent_buffer, GST_MAP_WRITE, &rtp); gst_rtp_buffer_set_seq (&rtp, self->next_seqnum++); gst_rtp_buffer_unmap (&rtp);