mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
buffer: Fix wrong size/index handling when merging memory
https://bugzilla.gnome.org/show_bug.cgi?id=702617
This commit is contained in:
parent
1de0c60c1a
commit
db80044513
1 changed files with 2 additions and 2 deletions
|
@ -216,7 +216,7 @@ _get_merged_memory (GstBuffer * buffer, guint idx, guint length)
|
|||
GstMemory *parent = NULL;
|
||||
gsize size, poffset = 0;
|
||||
|
||||
size = gst_buffer_get_size (buffer);
|
||||
size = gst_buffer_get_sizes_range (buffer, idx, length, NULL, NULL);
|
||||
|
||||
if (G_UNLIKELY (_is_span (mem + idx, length, &poffset, &parent))) {
|
||||
if (!GST_MEMORY_IS_NO_SHARE (parent))
|
||||
|
@ -236,7 +236,7 @@ _get_merged_memory (GstBuffer * buffer, guint idx, guint length)
|
|||
ptr = dinfo.data;
|
||||
left = size;
|
||||
|
||||
for (i = idx; i < length && left > 0; i++) {
|
||||
for (i = idx; i < (idx + length) && left > 0; i++) {
|
||||
gst_memory_map (mem[i], &sinfo, GST_MAP_READ);
|
||||
tocopy = MIN (sinfo.size, left);
|
||||
GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
|
||||
|
|
Loading…
Reference in a new issue