Couple more g_memdup() -> g_memdup2() fixes
authorTim-Philipp Müller <tim@centricular.com>
Fri, 29 Oct 2021 23:58:55 +0000 (00:58 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 30 Oct 2021 09:37:37 +0000 (10:37 +0100)
Fixes deprecation warnings with newer GLib versions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1279>

subprojects/gst-plugins-bad/gst/mpegtsmux/gstatscmux.c
subprojects/gst-plugins-bad/gst/mpegtsmux/gstbasetsmux.c
subprojects/gst-plugins-bad/gst/mpegtsmux/gstmpegtsmux.c
subprojects/gst-plugins-good/tests/check/elements/rtphdrext-colorspace.c

index f50f5df..88ced1f 100644 (file)
@@ -20,6 +20,9 @@
  *
  * SPDX-License-Identifier: LGPL-2.0-or-later
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "gstatscmux.h"
 
index 844a4ea..cecedbd 100644 (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;
index d5515a0..44c952e 100644 (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>
index 3a65bef..5c08cd3 100644 (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. */