diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-05-23 23:51:27 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-06-02 14:21:02 +0000 |
commit | 577dabf7b1ec020e8fb3e0b9106cabc40d0978b2 (patch) | |
tree | 81b65a4ce952d8757f2171e48008d0ac2caa6065 /gst-libs | |
parent | eb47c5aa2d7ec0158b7819c792871f6575840769 (diff) |
Use g_memdup2() where available and add fallback for older GLib versions
g_memdup() is deprecated since GLib 2.68 and we want to avoid
deprecation warnings with recent versions of GLib.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1171>
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/gl/x11/gstglcontext_glx.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/riff/riff-read.c | 8 | ||||
-rw-r--r-- | gst-libs/gst/rtp/gstrtcpbuffer.c | 4 | ||||
-rw-r--r-- | gst-libs/gst/rtp/gstrtpbuffer.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspconnection.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspmessage.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/sdp/gstmikey.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/video/video-anc.c | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/gst-libs/gst/gl/x11/gstglcontext_glx.c b/gst-libs/gst/gl/x11/gstglcontext_glx.c index e581a7d4c..68d8e636f 100644 --- a/gst-libs/gst/gl/x11/gstglcontext_glx.c +++ b/gst-libs/gst/gl/x11/gstglcontext_glx.c @@ -512,7 +512,7 @@ fb_config_attributes_from_structure (GstStructure * config) None }; - return g_memdup (attribs, sizeof (attribs)); + return g_memdup2 (attribs, sizeof (attribs)); } n = gst_structure_n_fields (config) * 2 + 1; diff --git a/gst-libs/gst/riff/riff-read.c b/gst-libs/gst/riff/riff-read.c index 4972979fe..5e9f331d9 100644 --- a/gst-libs/gst/riff/riff-read.c +++ b/gst-libs/gst/riff/riff-read.c @@ -293,7 +293,7 @@ gst_riff_parse_strh (GstElement * element, if (info.size < sizeof (gst_riff_strh)) goto too_small; - strh = g_memdup (info.data, info.size); + strh = g_memdup2 (info.data, info.size); gst_buffer_unmap (buf, &info); gst_buffer_unref (buf); @@ -384,7 +384,7 @@ gst_riff_parse_strf_vids (GstElement * element, if (info.size < sizeof (gst_riff_strf_vids)) goto too_small; - strf = g_memdup (info.data, info.size); + strf = g_memdup2 (info.data, info.size); gst_buffer_unmap (buf, &info); #if (G_BYTE_ORDER == G_BIG_ENDIAN) @@ -482,7 +482,7 @@ gst_riff_parse_strf_auds (GstElement * element, if (info.size < sizeof (gst_riff_strf_auds)) goto too_small; - strf = g_memdup (info.data, info.size); + strf = g_memdup2 (info.data, info.size); #if (G_BYTE_ORDER == G_BIG_ENDIAN) strf->format = GUINT16_FROM_LE (strf->format); @@ -574,7 +574,7 @@ gst_riff_parse_strf_iavs (GstElement * element, if (info.size < sizeof (gst_riff_strf_iavs)) goto too_small; - strf = g_memdup (info.data, info.size); + strf = g_memdup2 (info.data, info.size); gst_buffer_unmap (buf, &info); gst_buffer_unref (buf); diff --git a/gst-libs/gst/rtp/gstrtcpbuffer.c b/gst-libs/gst/rtp/gstrtcpbuffer.c index 29dfd82a0..876c4a9ef 100644 --- a/gst-libs/gst/rtp/gstrtcpbuffer.c +++ b/gst-libs/gst/rtp/gstrtcpbuffer.c @@ -84,7 +84,7 @@ gst_rtcp_buffer_new_take_data (gpointer data, guint len) GstBuffer * gst_rtcp_buffer_new_copy_data (gconstpointer data, guint len) { - return gst_rtcp_buffer_new_take_data (g_memdup (data, len), len); + return gst_rtcp_buffer_new_take_data (g_memdup2 (data, len), len); } static gboolean @@ -1213,7 +1213,7 @@ gst_rtcp_packet_copy_profile_specific_ext (GstRTCPPacket * packet, if (data != NULL) { guint8 *ptr = packet->rtcp->map.data + packet->offset; ptr += ((packet->length + 1 - pse_len) * sizeof (guint32)); - *data = g_memdup (ptr, pse_len * sizeof (guint32)); + *data = g_memdup2 (ptr, pse_len * sizeof (guint32)); } return TRUE; diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c index 739b7d96f..7d72cd9c5 100644 --- a/gst-libs/gst/rtp/gstrtpbuffer.c +++ b/gst-libs/gst/rtp/gstrtpbuffer.c @@ -184,7 +184,7 @@ gst_rtp_buffer_new_take_data (gpointer data, gsize len) GstBuffer * gst_rtp_buffer_new_copy_data (gconstpointer data, gsize len) { - return gst_rtp_buffer_new_take_data (g_memdup (data, len), len); + return gst_rtp_buffer_new_take_data (g_memdup2 (data, len), len); } /** diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 27a2dacc9..92e144cf8 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -4519,7 +4519,7 @@ gst_rtsp_watch_write_serialized_messages (GstRTSPWatch * watch, * we don't own them here */ if (local_message.body_data) { local_message.body_data = - g_memdup (local_message.body_data, local_message.body_data_size); + g_memdup2 (local_message.body_data, local_message.body_data_size); } else if (local_message.body_buffer) { gst_buffer_ref (local_message.body_buffer); } diff --git a/gst-libs/gst/rtsp/gstrtspmessage.c b/gst-libs/gst/rtsp/gstrtspmessage.c index 3b693fa16..dea542120 100644 --- a/gst-libs/gst/rtsp/gstrtspmessage.c +++ b/gst-libs/gst/rtsp/gstrtspmessage.c @@ -943,7 +943,7 @@ gst_rtsp_message_set_body (GstRTSPMessage * msg, const guint8 * data, { g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL); - return gst_rtsp_message_take_body (msg, g_memdup (data, size), size); + return gst_rtsp_message_take_body (msg, g_memdup2 (data, size), size); } /** diff --git a/gst-libs/gst/sdp/gstmikey.c b/gst-libs/gst/sdp/gstmikey.c index 4f8a31389..cacabb730 100644 --- a/gst-libs/gst/sdp/gstmikey.c +++ b/gst-libs/gst/sdp/gstmikey.c @@ -66,7 +66,7 @@ G_STMT_START { \ #define INIT_MEMDUP(field, data, len) \ G_STMT_START { \ g_free ((field)); \ - (field) = g_memdup (data, len); \ + (field) = g_memdup2 (data, len); \ } G_STMT_END #define FREE_MEMDUP(field) \ G_STMT_START { \ diff --git a/gst-libs/gst/video/video-anc.c b/gst-libs/gst/video/video-anc.c index bac275a6a..64d879217 100644 --- a/gst-libs/gst/video/video-anc.c +++ b/gst-libs/gst/video/video-anc.c @@ -1031,7 +1031,7 @@ gst_buffer_add_video_caption_meta (GstBuffer * buffer, g_return_val_if_fail (meta != NULL, NULL); meta->caption_type = caption_type; - meta->data = g_memdup (data, size); + meta->data = g_memdup2 (data, size); meta->size = size; return meta; |