summaryrefslogtreecommitdiff
path: root/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2021-05-23 19:15:25 +0100
committerNirbheek Chauhan <nirbheek@centricular.com>2021-08-05 20:51:00 +0530
commita561b1bd8601ed8ae8769339cc8d93c2c23e2d84 (patch)
tree632d06f7df0536e5e083826b182ddaf50a9503b1 /gst-libs/gst/mpegts/gstmpegtsdescriptor.c
parent743387052856352c9baa66b6c5c197e3ec5f452b (diff)
downloadgstreamer-plugins-bad-a561b1bd8601ed8ae8769339cc8d93c2c23e2d84.tar.gz
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-bad/-/merge_requests/2280>
Diffstat (limited to 'gst-libs/gst/mpegts/gstmpegtsdescriptor.c')
-rw-r--r--gst-libs/gst/mpegts/gstmpegtsdescriptor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
index e63aa5c22..e6b18c1be 100644
--- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
+++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.c
@@ -700,7 +700,7 @@ _copy_descriptor (GstMpegtsDescriptor * desc)
GstMpegtsDescriptor *copy;
copy = g_slice_dup (GstMpegtsDescriptor, desc);
- copy->data = g_memdup (desc->data, desc->length + 2);
+ copy->data = g_memdup2 (desc->data, desc->length + 2);
return copy;
}
@@ -788,7 +788,7 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len)
desc->tag = *data++;
desc->length = *data++;
/* Copy the data now that we known the size */
- desc->data = g_memdup (desc->data, desc->length + 2);
+ desc->data = g_memdup2 (desc->data, desc->length + 2);
GST_LOG ("descriptor 0x%02x length:%d", desc->tag, desc->length);
GST_MEMDUMP ("descriptor", desc->data + 2, desc->length);
/* extended descriptors */