From: Matthew Waters Date: Thu, 12 Dec 2024 01:05:04 +0000 (+1100) Subject: rtppassthroughpay: ensure buffer is writable before mapping writable X-Git-Tag: 1.24.11~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c46e70bf271d53acfe863845ee3d62b405055506;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/subprojects/gst-plugins-good/gst/rtp/gstrtppassthroughpay.c b/subprojects/gst-plugins-good/gst/rtp/gstrtppassthroughpay.c index 9d97270f62..693d270859 100644 --- a/subprojects/gst-plugins-good/gst/rtp/gstrtppassthroughpay.c +++ b/subprojects/gst-plugins-good/gst/rtp/gstrtppassthroughpay.c @@ -23,12 +23,12 @@ * * This elements pass RTP packets along unchanged and appear as a RTP * payloader element to the outside world. - * + * * This is useful, for example, in the case where you are receiving RTP * packets from a different source and want to serve them over RTSP. Since the * gst-rtsp-server library expect the element marked as `payX` to be a RTP * payloader element and assumes certain properties are available. - * + * * ## Example pipelines * * |[ @@ -333,6 +333,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);