Couple more g_memdup() -> g_memdup2() fixes

Fixes deprecation warnings with newer GLib versions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1279>
This commit is contained in:
Tim-Philipp Müller 2021-10-30 00:58:55 +01:00
parent 1f560af76b
commit ea8dc0c737
4 changed files with 14 additions and 5 deletions

View file

@ -20,6 +20,9 @@
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstatscmux.h"

View file

@ -65,6 +65,9 @@
*
* SPDX-License-Identifier: MPL-1.1 OR MIT OR LGPL-2.0-or-later
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>
@ -1818,7 +1821,7 @@ handle_scte35_section (GstBaseTsMux * mux, GstEvent * event,
GSTTIME_TO_MPEGTIME (gst_event_get_running_time_offset (event));
pts_adjust &= 0x1ffffffff;
section_data = g_memdup (section->data, section->section_length);
section_data = g_memdup2 (section->data, section->section_length);
section_data[4] |= pts_adjust >> 32;
section_data[5] = pts_adjust >> 24;
section_data[6] = pts_adjust >> 16;

View file

@ -76,6 +76,9 @@
*
* {{ tests/examples/mpegts/ts-section-writer.c }}
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstmpegtsmux.h"
#include <string.h>

View file

@ -98,8 +98,8 @@ GST_START_TEST (test_rtphdrext_colorspace_onebyte)
gst_harness_set_src_caps (h, src_caps);
gst_harness_push (h, gst_buffer_new_wrapped (g_memdup (vp8_payload,
sizeof (vp8_payload)), sizeof (vp8_payload)));
gst_harness_push (h,
gst_buffer_new_memdup (vp8_payload, sizeof (vp8_payload)));
/* verify depayloader correctly reconstructs colorspace information in
* its srccaps. */
@ -192,8 +192,8 @@ GST_START_TEST (test_rtphdrext_colorspace_twobyte)
gst_harness_set_src_caps (h, src_caps);
gst_harness_push (h, gst_buffer_new_wrapped (g_memdup (vp8_payload,
sizeof (vp8_payload)), sizeof (vp8_payload)));
gst_harness_push (h,
gst_buffer_new_memdup (vp8_payload, sizeof (vp8_payload)));
/* verify depayloader correctly reconstructs colorspace information in
* its srccaps. */