summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-04-04 01:48:44 +0200
committerTim-Philipp Müller <tim@centricular.com>2018-04-11 23:29:49 +0100
commit91db2da3e2cb4ffa7029eb96206a8dfad7a35c3c (patch)
tree8227e62fc9187d230c01494eee7b8f994cb17480
parentea53d9fedc322355842bc3e34a998cbf5e8b8ac6 (diff)
rtxsend: fix wrong memory layout assumption
The code responsible for creating retransmitted buffers assumed the stored buffer had been created with rtp_buffer_new_allocate when copying the extension data, which isn't necessarily the case, for example when the rtp buffers come from a udpsrc. https://bugzilla.gnome.org/show_bug.cgi?id=794958
-rw-r--r--gst/rtpmanager/gstrtprtxsend.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/rtpmanager/gstrtprtxsend.c b/gst/rtpmanager/gstrtprtxsend.c
index 4329d8496..58892f3cf 100644
--- a/gst/rtpmanager/gstrtprtxsend.c
+++ b/gst/rtpmanager/gstrtprtxsend.c
@@ -400,7 +400,10 @@ gst_rtp_rtx_buffer_new (GstRtpRtxSend * rtx, GstBuffer * buffer)
/* copy extension if any */
if (rtp.size[1]) {
- mem = gst_memory_copy (rtp.map[1].memory, 0, rtp.size[1]);
+ mem = gst_allocator_alloc (NULL, rtp.size[1], NULL);
+ gst_memory_map (mem, &map, GST_MAP_WRITE);
+ memcpy (map.data, rtp.data[1], rtp.size[1]);
+ gst_memory_unmap (mem, &map);
gst_buffer_append_memory (new_buffer, mem);
}