[gegl/abyss] buffer: respect stride and width in iterators
- From: Ville Sokk <villesokk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/abyss] buffer: respect stride and width in iterators
- Date: Tue, 17 Jul 2012 16:56:05 +0000 (UTC)
commit 2397be6f8e67c4f6be05871fd547a4ad631f042b
Author: Ville Sokk <ville sokk gmail com>
Date: Tue Jul 17 19:53:24 2012 +0300
buffer: respect stride and width in iterators
gegl/buffer/gegl-buffer-access.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 7aecf18..7164bfa 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -621,13 +621,13 @@ gegl_buffer_iterate_read_abyss_none (GeglBuffer *buffer,
{ /* entire row of tiles is in abyss */
gint row;
gint y = bufy;
- guchar *bp = buf + ((bufy) * width) * bpx_size;
+ guchar *bp = buf + bufy * buf_stride;
for (row = offsety;
row < tile_height && y < height;
row++, y++)
{
- memset (bp, 0x00, buf_stride);
+ memset (bp, 0x00, width * bpx_size);
bp += buf_stride;
}
}
@@ -778,13 +778,13 @@ gegl_buffer_iterate_read_abyss_color (GeglBuffer *buffer,
{ /* entire row of tiles is in abyss */
gint row;
gint y = bufy;
- guchar *bp = buf + ((bufy) * width) * bpx_size;
+ guchar *bp = buf + bufy * buf_stride;
for (row = offsety;
row < tile_height && y < height;
row++, y++)
{
- for (i = 0; i < buf_stride; i += bpx_size)
+ for (i = 0; i < width * bpx_size; i += bpx_size)
memcpy (bp + i, color, bpx_size);
bp += buf_stride;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]