From a561b1bd8601ed8ae8769339cc8d93c2c23e2d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 23 May 2021 19:15:25 +0100 Subject: 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: --- ext/curl/gstcurlbasesink.c | 2 +- ext/curl/gstcurlhttpsrc.c | 2 +- ext/faad/gstfaad.c | 2 +- ext/hls/gsthlsdemux.c | 2 +- ext/teletextdec/gstteletextdec.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/curl/gstcurlbasesink.c b/ext/curl/gstcurlbasesink.c index 3b4e062c0..9d232e846 100644 --- a/ext/curl/gstcurlbasesink.c +++ b/ext/curl/gstcurlbasesink.c @@ -1092,7 +1092,7 @@ gst_curl_base_sink_debug_cb (CURL * handle, curl_infotype type, char *data, case CURLINFO_TEXT: case CURLINFO_HEADER_IN: case CURLINFO_HEADER_OUT: - msg = g_memdup (data, size); + msg = g_memdup2 (data, size); if (size > 0) { msg[size - 1] = '\0'; g_strchomp (msg); diff --git a/ext/curl/gstcurlhttpsrc.c b/ext/curl/gstcurlhttpsrc.c index a68156659..a8de12e82 100644 --- a/ext/curl/gstcurlhttpsrc.c +++ b/ext/curl/gstcurlhttpsrc.c @@ -2127,7 +2127,7 @@ gst_curl_http_src_get_debug (CURL * handle, curl_infotype type, char *data, switch (type) { case CURLINFO_TEXT: case CURLINFO_HEADER_OUT: - msg = g_memdup (data, size); + msg = g_memdup2 (data, size); if (size > 0) { msg[size - 1] = '\0'; g_strchomp (msg); diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c index 0d9a00476..cdfe79127 100644 --- a/ext/faad/gstfaad.c +++ b/ext/faad/gstfaad.c @@ -451,7 +451,7 @@ gst_faad_update_caps (GstFaad * faad, faacDecFrameInfo * info) faad->samplerate = info->samplerate; faad->channels = info->channels; g_free (faad->channel_positions); - faad->channel_positions = g_memdup (info->channel_position, faad->channels); + faad->channel_positions = g_memdup2 (info->channel_position, faad->channels); faad->bps = 16 / 8; diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index 46e99f41c..8cf6c2acc 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -1280,7 +1280,7 @@ gst_hls_demux_update_fragment_info (GstAdaptiveDemuxStream * stream) g_free (hlsdemux_stream->current_key); hlsdemux_stream->current_key = g_strdup (file->key); g_free (hlsdemux_stream->current_iv); - hlsdemux_stream->current_iv = g_memdup (file->iv, sizeof (file->iv)); + hlsdemux_stream->current_iv = g_memdup2 (file->iv, sizeof (file->iv)); g_free (stream->fragment.uri); stream->fragment.uri = g_strdup (file->uri); diff --git a/ext/teletextdec/gstteletextdec.c b/ext/teletextdec/gstteletextdec.c index c0b12d044..5b4abfd6a 100644 --- a/ext/teletextdec/gstteletextdec.c +++ b/ext/teletextdec/gstteletextdec.c @@ -540,7 +540,7 @@ gst_teletextdec_process_telx_buffer (GstTeletextDec * teletext, GstBuffer * buf) n_lines = teletext->frame->current_slice - teletext->frame->sliced_begin; GST_LOG_OBJECT (teletext, "Completed frame, decoding new %d lines", n_lines); - s = g_memdup (teletext->frame->sliced_begin, + s = g_memdup2 (teletext->frame->sliced_begin, n_lines * sizeof (vbi_sliced)); vbi_decode (teletext->decoder, s, n_lines, teletext->last_ts); /* From vbi_decode(): -- cgit v1.2.1