gstbuffer: Use g_memdup2 instead of g_memdup
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 13 Aug 2021 13:51:41 +0000 (19:21 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Fri, 13 Aug 2021 14:25:42 +0000 (19:55 +0530)
This was added in !826 which was created after !803 (which changes
g_memdup -> g_memdup2), but merged before it, so it slipped through.

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

gst/gstbuffer.c

index a766796..d3d0898 100644 (file)
 #include "gstutils.h"
 #include "gstversion.h"
 
+/* For g_memdup2 */
+#include "glib-compat-private.h"
+
 GType _gst_buffer_type = 0;
 
 /* info->size will be sizeof(FooMeta) which contains a GstMeta at the beginning
@@ -1053,7 +1056,7 @@ gst_buffer_new_wrapped_bytes (GBytes * bytes)
 GstBuffer *
 gst_buffer_new_memdup (gconstpointer data, gsize size)
 {
-  gpointer data2 = g_memdup (data, size);
+  gpointer data2 = g_memdup2 (data, size);
 
   return gst_buffer_new_wrapped_full (0, data2, size, 0, size, data2, g_free);
 }