From e2e9e321f6ee4484abd4e28a33a9c8256eeac4b4 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Mon, 24 May 2021 19:01:24 +0200 Subject: [PATCH] rtpbasepayload: map RTP buffer READWRITE when setting headers GstRTPHeaderExtension::write can map the RTP buffer for reading. If that happens on a buffer that is already mapped WRITE-only by the payloader, the payloader's mapping gets invalidated (GstRTPBuffer::map will point to a different instance of GstMemory). Part-of: --- gst-libs/gst/rtp/gstrtpbasepayload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/rtp/gstrtpbasepayload.c b/gst-libs/gst/rtp/gstrtpbasepayload.c index 8631d91cfa..21012123ba 100644 --- a/gst-libs/gst/rtp/gstrtpbasepayload.c +++ b/gst-libs/gst/rtp/gstrtpbasepayload.c @@ -1711,7 +1711,7 @@ set_headers (GstBuffer ** buffer, guint idx, gpointer user_data) HeaderExt hdrext = { NULL, }; GstRTPBuffer rtp = { NULL, }; - if (!gst_rtp_buffer_map (*buffer, GST_MAP_WRITE, &rtp)) + if (!gst_rtp_buffer_map (*buffer, GST_MAP_READWRITE, &rtp)) goto map_failed; gst_rtp_buffer_set_ssrc (&rtp, data->ssrc);