rtppassthroughpay: ensure buffer is writable before mapping writable

It is entirely possible that the incoming buffer into _chain() is not writable
and will result in a critical when trying to map().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8131>
This commit is contained in:
Matthew Waters 2024-12-12 12:05:04 +11:00
parent a3a7acdd0a
commit c3cc8205b2

View file

@ -419,6 +419,8 @@ gst_rtp_passthrough_pay_chain (GstPad * pad,
GstRTPBuffer rtp_buffer = GST_RTP_BUFFER_INIT;
guint pt, ssrc, seqnum, timestamp;
buffer = gst_buffer_make_writable (buffer);
if (!gst_rtp_buffer_map (buffer, GST_MAP_READWRITE, &rtp_buffer)) {
GST_ERROR_OBJECT (self, "Invalid RTP buffer");
return gst_pad_push (self->srcpad, buffer);