diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-05-23 19:15:25 +0100 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-08-05 20:51:00 +0530 |
commit | a561b1bd8601ed8ae8769339cc8d93c2c23e2d84 (patch) | |
tree | 632d06f7df0536e5e083826b182ddaf50a9503b1 /ext | |
parent | 743387052856352c9baa66b6c5c197e3ec5f452b (diff) | |
download | gstreamer-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 'ext')
-rw-r--r-- | ext/curl/gstcurlbasesink.c | 2 | ||||
-rw-r--r-- | ext/curl/gstcurlhttpsrc.c | 2 | ||||
-rw-r--r-- | ext/faad/gstfaad.c | 2 | ||||
-rw-r--r-- | ext/hls/gsthlsdemux.c | 2 | ||||
-rw-r--r-- | ext/teletextdec/gstteletextdec.c | 2 |
5 files changed, 5 insertions, 5 deletions
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(): |