From 04c5a550adae36e831b6f457ca72c9a130f3c4b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 7 Jan 2020 20:17:12 +0200 Subject: [PATCH] webrtc: Unmap all non-binary buffers received via the datachannel Previously they were only unmapped in case of binary data, causing all of them to be leaked. --- ext/webrtc/webrtcdatachannel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/webrtc/webrtcdatachannel.c b/ext/webrtc/webrtcdatachannel.c index 139ec7a..c8332ac 100644 --- a/ext/webrtc/webrtcdatachannel.c +++ b/ext/webrtc/webrtcdatachannel.c @@ -616,6 +616,7 @@ _data_channel_have_sample (GstWebRTCDataChannel * channel, GstSample * sample, ret = GST_FLOW_ERROR; } else { ret = _parse_control_packet (channel, info.data, info.size, error); + gst_buffer_unmap (buffer, &info); } break; } @@ -631,6 +632,7 @@ _data_channel_have_sample (GstWebRTCDataChannel * channel, GstSample * sample, gchar *str = g_strndup ((gchar *) info.data, info.size); _channel_enqueue_task (channel, (ChannelTask) _emit_have_string, str, g_free); + gst_buffer_unmap (buffer, &info); } break; } -- 2.7.4