mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
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:
parent
a3a7acdd0a
commit
c3cc8205b2
1 changed files with 4 additions and 2 deletions
|
@ -23,12 +23,12 @@
|
||||||
*
|
*
|
||||||
* This elements pass RTP packets along unchanged and appear as a RTP
|
* This elements pass RTP packets along unchanged and appear as a RTP
|
||||||
* payloader element to the outside world.
|
* payloader element to the outside world.
|
||||||
*
|
*
|
||||||
* This is useful, for example, in the case where you are receiving RTP
|
* 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
|
* 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
|
* gst-rtsp-server library expect the element marked as `payX` to be a RTP
|
||||||
* payloader element and assumes certain properties are available.
|
* payloader element and assumes certain properties are available.
|
||||||
*
|
*
|
||||||
* ## Example pipelines
|
* ## Example pipelines
|
||||||
*
|
*
|
||||||
* |[
|
* |[
|
||||||
|
@ -419,6 +419,8 @@ gst_rtp_passthrough_pay_chain (GstPad * pad,
|
||||||
GstRTPBuffer rtp_buffer = GST_RTP_BUFFER_INIT;
|
GstRTPBuffer rtp_buffer = GST_RTP_BUFFER_INIT;
|
||||||
guint pt, ssrc, seqnum, timestamp;
|
guint pt, ssrc, seqnum, timestamp;
|
||||||
|
|
||||||
|
buffer = gst_buffer_make_writable (buffer);
|
||||||
|
|
||||||
if (!gst_rtp_buffer_map (buffer, GST_MAP_READWRITE, &rtp_buffer)) {
|
if (!gst_rtp_buffer_map (buffer, GST_MAP_READWRITE, &rtp_buffer)) {
|
||||||
GST_ERROR_OBJECT (self, "Invalid RTP buffer");
|
GST_ERROR_OBJECT (self, "Invalid RTP buffer");
|
||||||
return gst_pad_push (self->srcpad, buffer);
|
return gst_pad_push (self->srcpad, buffer);
|
||||||
|
|
Loading…
Reference in a new issue