rtpbuffer: The out args for rtp extension data are optional
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 15 Mar 2022 07:27:49 +0000 (12:57 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 16 Mar 2022 02:48:34 +0000 (02:48 +0000)
The code checks that these are != NULL before dereferencing them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1962>

subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtpbuffer.c

index 399724d..d83bbd2 100644 (file)
@@ -684,9 +684,9 @@ gst_rtp_buffer_set_extension (GstRTPBuffer * rtp, gboolean extension)
 /**
  * gst_rtp_buffer_get_extension_data: (skip)
  * @rtp: the RTP packet
- * @bits: (out): location for result bits
- * @data: (out) (array) (element-type guint8) (transfer none): location for data
- * @wordlen: (out): location for length of @data in 32 bits words
+ * @bits: (optional) (out): location for result bits
+ * @data: (optional) (out) (array) (element-type guint8) (transfer none): location for data
+ * @wordlen: (optional) (out): location for length of @data in 32 bits words
  *
  * Get the extension data. @bits will contain the extension 16 bits of custom
  * data. @data will point to the data in the extension and @wordlen will contain
@@ -1457,9 +1457,9 @@ gst_rtp_buffer_get_extension_onebyte_header_from_bytes (GBytes * bytes,
  * @rtp: the RTP packet
  * @id: The ID of the header extension to be read (between 1 and 14).
  * @nth: Read the nth extension packet with the requested ID
- * @data: (out) (array length=size) (element-type guint8) (transfer none):
+ * @data: (optional) (out) (array length=size) (element-type guint8) (transfer none):
  *   location for data
- * @size: (out): the size of the data in bytes
+ * @size: (optional) (out): the size of the data in bytes
  *
  * Parses RFC 5285 style header extensions with a one byte header. It will
  * return the nth extension with the requested id.
@@ -1487,12 +1487,12 @@ gst_rtp_buffer_get_extension_onebyte_header (GstRTPBuffer * rtp, guint8 id,
 /**
  * gst_rtp_buffer_get_extension_twobytes_header:
  * @rtp: the RTP packet
- * @appbits: (out): Application specific bits
+ * @appbits: (optional) (out): Application specific bits
  * @id: The ID of the header extension to be read (between 1 and 14).
  * @nth: Read the nth extension packet with the requested ID
- * @data: (out) (array length=size) (element-type guint8) (transfer none):
+ * @data: (optional) (out) (array length=size) (element-type guint8) (transfer none):
  *   location for data
- * @size: (out): the size of the data in bytes
+ * @size: (optional) (out): the size of the data in bytes
  *
  * Parses RFC 5285 style header extensions with a two bytes header. It will
  * return the nth extension with the requested id.