TT#14008 handle deprecated g_memdup

GLib 2.68 deprecates g_memdup() in favour of g_memdup2() as the former
was using a guint second argument which could lead to integer overflows
(gsize should be used instead).

Change-Id: Iaa3e3b1ecaab00d1ac887c915397b15b7204dd11
rfuchs/1283
Richard Fuchs 5 years ago
parent 1b49b43135
commit 25cb6ff857

@ -1954,8 +1954,8 @@ void media_packet_copy(struct media_packet *dst, const struct media_packet *src)
obj_hold(&dst->ssrc_in->parent->h);
if (dst->ssrc_out)
obj_hold(&dst->ssrc_out->parent->h);
dst->rtp = g_memdup(src->rtp, sizeof(*src->rtp));
dst->rtcp = g_memdup(src->rtp, sizeof(*src->rtp));
dst->rtp = __g_memdup(src->rtp, sizeof(*src->rtp));
dst->rtcp = __g_memdup(src->rtp, sizeof(*src->rtp));
dst->payload = STR_NULL;
dst->raw = STR_NULL;
}

@ -300,5 +300,11 @@ INLINE void __g_hash_table_destroy(GHashTable **s) {
g_hash_table_destroy(*s);
}
#if !GLIB_CHECK_VERSION(2,68,0)
# define __g_memdup(a,b) g_memdup(a,b)
#else
# define __g_memdup(a,b) g_memdup2(a,b)
#endif
#endif

Loading…
Cancel
Save