rtpulpfecdec: fix buffer leak when packet is recovered from storage
authorMathieu Duponchelle <mathieu@centricular.com>
Wed, 6 Mar 2019 17:38:03 +0000 (17:38 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 6 Mar 2019 19:40:10 +0000 (19:40 +0000)
Exposed by rtpulpfecdec_recovered_from_storage test.

gst/rtp/gstrtpulpfecdec.c

index da29371..59c09fb 100644 (file)
@@ -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);