From 9c084faa751afeed478460307da33b88a60ac7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Brzezi=C5=84ski?= Date: Mon, 11 Mar 2024 18:13:37 +0100 Subject: [PATCH] qtdemux: Fix wrapping temporary memory in buffers That memory can disappear at any moment, doesn't cost much to just copy those few bytes. Part-of: --- subprojects/gst-plugins-good/gst/isomp4/qtdemux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c b/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c index 068a569a5f..bf6bbf6659 100644 --- a/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c +++ b/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c @@ -4033,7 +4033,7 @@ qtdemux_parse_sgpd (GstQTDemux * qtdemux, QtDemuxStream * stream, skip_byte_block = possible_pattern_info & 0x0f; } - kid_buf = _gst_buffer_new_wrapped ((guint8 *) kid, 16, NULL); + kid_buf = gst_buffer_new_memdup (kid, 16); props = gst_structure_new ("application/x-cenc", "iv_size", G_TYPE_UINT, iv_size, @@ -4050,8 +4050,8 @@ qtdemux_parse_sgpd (GstQTDemux * qtdemux, QtDemuxStream * stream, } if (constant_iv != NULL) { - GstBuffer *constant_iv_buf = _gst_buffer_new_wrapped ( - (guint8 *) constant_iv, constant_iv_size, NULL); + GstBuffer *constant_iv_buf = gst_buffer_new_memdup ( + (guint8 *) constant_iv, constant_iv_size); gst_structure_set (props, "constant_iv_size", G_TYPE_UINT, constant_iv_size, "iv", GST_TYPE_BUFFER, constant_iv_buf, NULL);