summaryrefslogtreecommitdiff
path: root/gst/mxf
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/mxf
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/mxf')
-rw-r--r--gst/mxf/mxfaes-bwf.c4
-rw-r--r--gst/mxf/mxfdms1.c2
-rw-r--r--gst/mxf/mxfmetadata.c2
-rw-r--r--gst/mxf/mxfmpeg.c2
-rw-r--r--gst/mxf/mxftypes.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/gst/mxf/mxfaes-bwf.c b/gst/mxf/mxfaes-bwf.c
index f0cd37c1e..d828233ff 100644
--- a/gst/mxf/mxfaes-bwf.c
+++ b/gst/mxf/mxfaes-bwf.c
@@ -211,7 +211,7 @@ mxf_metadata_wave_audio_essence_descriptor_handle_tag (MXFMetadataBase *
mxf_timestamp_to_string (&self->peak_envelope_timestamp, str));
break;
case 0x3d31:
- self->peak_envelope_data = g_memdup (tag_data, tag_size);
+ self->peak_envelope_data = g_memdup2 (tag_data, tag_size);
self->peak_envelope_data_length = tag_size;
GST_DEBUG (" peak evelope data size = %u",
self->peak_envelope_data_length);
@@ -507,7 +507,7 @@ mxf_metadata_wave_audio_essence_descriptor_write_tags (MXFMetadataBase * m,
t = g_slice_new0 (MXFLocalTag);
memcpy (&t->ul, &peak_envelope_data_ul, 16);
t->size = self->peak_envelope_data_length;
- t->data = g_memdup (self->peak_envelope_data, t->size);
+ t->data = g_memdup2 (self->peak_envelope_data, t->size);
mxf_primer_pack_add_mapping (primer, 0x3d31, &t->ul);
ret = g_list_prepend (ret, t);
}
diff --git a/gst/mxf/mxfdms1.c b/gst/mxf/mxfdms1.c
index bb5234e8f..6a611f8a3 100644
--- a/gst/mxf/mxfdms1.c
+++ b/gst/mxf/mxfdms1.c
@@ -1656,7 +1656,7 @@ mxf_dms1_identification_handle_tag (MXFMetadataBase * metadata,
memcpy (self->identifier_kind, tag_data, tag_size);
GST_DEBUG (" identifier kind = %s", self->identifier_kind);
} else if (memcmp (tag_ul, &identifier_value_ul, 16) == 0) {
- self->identifier_value = g_memdup (tag_data, tag_size);
+ self->identifier_value = g_memdup2 (tag_data, tag_size);
self->identifier_value_length = tag_size;
GST_DEBUG (" identifier value length = %u", tag_size);
} else if (memcmp (tag_ul, &identification_locator_ul, 16) == 0) {
diff --git a/gst/mxf/mxfmetadata.c b/gst/mxf/mxfmetadata.c
index ac147d541..298f05942 100644
--- a/gst/mxf/mxfmetadata.c
+++ b/gst/mxf/mxfmetadata.c
@@ -252,7 +252,7 @@ mxf_metadata_base_to_buffer (MXFMetadataBase * self, MXFPrimerPack * primer)
mxf_primer_pack_add_mapping (primer, 0x0000, &t->ul);
memcpy (tmp->data, t->data, t->size);
} else {
- tmp->data = g_memdup (t->data, t->size);
+ tmp->data = g_memdup2 (t->data, t->size);
}
tags = g_list_prepend (tags, tmp);
}
diff --git a/gst/mxf/mxfmpeg.c b/gst/mxf/mxfmpeg.c
index cb89696cf..2025437d2 100644
--- a/gst/mxf/mxfmpeg.c
+++ b/gst/mxf/mxfmpeg.c
@@ -1321,7 +1321,7 @@ mxf_mpeg_video_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
codec_data = gst_value_get_buffer (v);
gst_buffer_map ((GstBuffer *) codec_data, &map, GST_MAP_READ);
t->size = map.size;
- t->data = g_memdup (map.data, map.size);
+ t->data = g_memdup2 (map.data, map.size);
gst_buffer_unmap ((GstBuffer *) codec_data, &map);
memcpy (&t->ul, &sony_mpeg4_extradata, 16);
mxf_local_tag_insert (t, &MXF_METADATA_BASE (ret)->other_tags);
diff --git a/gst/mxf/mxftypes.c b/gst/mxf/mxftypes.c
index f5c2852e3..73a886907 100644
--- a/gst/mxf/mxftypes.c
+++ b/gst/mxf/mxftypes.c
@@ -1706,7 +1706,7 @@ mxf_local_tag_add_to_hash_table (const MXFPrimerPack * primer,
local_tag = g_slice_new0 (MXFLocalTag);
memcpy (&local_tag->ul, ul, sizeof (MXFUL));
local_tag->size = tag_size;
- local_tag->data = tag_size == 0 ? NULL : g_memdup (tag_data, tag_size);
+ local_tag->data = tag_size == 0 ? NULL : g_memdup2 (tag_data, tag_size);
local_tag->g_slice = FALSE;
g_hash_table_insert (*hash_table, &local_tag->ul, local_tag);