[gegl/abyss: 16/22] buffer: fixed memory bug in CLAMP abyss policy
- From: Ville Sokk <villesokk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/abyss: 16/22] buffer: fixed memory bug in CLAMP abyss policy
- Date: Thu, 2 Aug 2012 18:04:19 +0000 (UTC)
commit a4211259615d8ec1d2629dfa59323067ea12fc77
Author: Ville Sokk <ville sokk gmail com>
Date: Sun Jul 8 20:00:08 2012 +0300
buffer: fixed memory bug in CLAMP abyss policy
gegl/buffer/gegl-buffer-access.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 47d6b5e..38672a1 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -980,13 +980,13 @@ gegl_buffer_iterate_read_abyss_clamp (GeglBuffer *buffer,
{ /* x was clamped. Copy a single color since x remains clamped in
this iteration. */
guchar color[128];
- gint i;
+ gint i;
/* gap between current column and left side of abyss rect */
lskip = (buffer_abyss_x) - (buffer_x + bufx);
/* gap between current column and end of roi */
rskip = width - bufx;
- pixels = (lskip > 0) ? lskip : rskip;
+ pixels = (lskip > 0 && lskip < width) ? lskip : rskip;
if (row_in_abyss)
{ /* y remains clamped in this iteration so don't change the color */
@@ -1018,8 +1018,8 @@ gegl_buffer_iterate_read_abyss_clamp (GeglBuffer *buffer,
for (i = 0; i < pixels * bpx_size; i += bpx_size)
memcpy (bp + i, color, bpx_size);
- if (buffer_y + y >= buffer_abyss_y
- && buffer_y + y < abyss_y_total - 1)
+ if (buffer_y + y >= buffer_abyss_y &&
+ buffer_y + y < abyss_y_total - 1)
tp += tile_stride;
bp += buf_stride;
}
@@ -1046,8 +1046,8 @@ gegl_buffer_iterate_read_abyss_clamp (GeglBuffer *buffer,
else
memcpy (bp, tp, pixels * px_size);
- if (buffer_y + y >= buffer_abyss_y
- && buffer_y + y < abyss_y_total - 1)
+ if (buffer_y + y >= buffer_abyss_y &&
+ buffer_y + y < abyss_y_total - 1)
tp += tile_stride;
bp += buf_stride;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]