rtpbasepayload: Don't write header extensions if there's no corresponding input buffer for the packet

The GstRTPHeaderExtension API requires the input buffer to exist.

This can happen if the output packet is generated e.g. from a caps or
tags event like in the case for rtpgstpay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2198>
This commit is contained in:
Sebastian Dröge 2022-04-15 19:55:34 +03:00
parent 488b760e7e
commit fa070d20cf

View file

@ -1718,7 +1718,8 @@ set_headers (GstBuffer ** buffer, guint idx, gpointer user_data)
gst_rtp_buffer_set_timestamp (&rtp, data->rtptime);
GST_OBJECT_LOCK (data->payload);
if (data->payload->priv->header_exts->len > 0) {
if (data->payload->priv->header_exts->len > 0
&& data->payload->priv->input_meta_buffer) {
guint wordlen;
gsize extlen;
guint16 bit_pattern;