mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +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;
|
GstMemory *parent = NULL;
|
||||||
gsize size, poffset = 0;
|
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 (G_UNLIKELY (_is_span (mem + idx, length, &poffset, &parent))) {
|
||||||
if (!GST_MEMORY_IS_NO_SHARE (parent))
|
if (!GST_MEMORY_IS_NO_SHARE (parent))
|
||||||
|
@ -236,7 +236,7 @@ _get_merged_memory (GstBuffer * buffer, guint idx, guint length)
|
||||||
ptr = dinfo.data;
|
ptr = dinfo.data;
|
||||||
left = size;
|
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);
|
gst_memory_map (mem[i], &sinfo, GST_MAP_READ);
|
||||||
tocopy = MIN (sinfo.size, left);
|
tocopy = MIN (sinfo.size, left);
|
||||||
GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
|
GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
|
||||||
|
|
Loading…
Reference in a new issue