mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-07 07:55:41 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6339>
This commit is contained in:
parent
eff6167d2d
commit
6b369d8470
1 changed files with 3 additions and 3 deletions
|
@ -4033,7 +4033,7 @@ qtdemux_parse_sgpd (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
skip_byte_block = possible_pattern_info & 0x0f;
|
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",
|
props = gst_structure_new ("application/x-cenc",
|
||||||
"iv_size", G_TYPE_UINT, iv_size,
|
"iv_size", G_TYPE_UINT, iv_size,
|
||||||
|
@ -4050,8 +4050,8 @@ qtdemux_parse_sgpd (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (constant_iv != NULL) {
|
if (constant_iv != NULL) {
|
||||||
GstBuffer *constant_iv_buf = _gst_buffer_new_wrapped (
|
GstBuffer *constant_iv_buf = gst_buffer_new_memdup (
|
||||||
(guint8 *) constant_iv, constant_iv_size, NULL);
|
(guint8 *) constant_iv, constant_iv_size);
|
||||||
gst_structure_set (props,
|
gst_structure_set (props,
|
||||||
"constant_iv_size", G_TYPE_UINT, constant_iv_size,
|
"constant_iv_size", G_TYPE_UINT, constant_iv_size,
|
||||||
"iv", GST_TYPE_BUFFER, constant_iv_buf, NULL);
|
"iv", GST_TYPE_BUFFER, constant_iv_buf, NULL);
|
||||||
|
|
Loading…
Reference in a new issue