[gegl] stretch-contrast: Clean up 1st cl_iter on failure
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] stretch-contrast: Clean up 1st cl_iter on failure
- Date: Sun, 3 Nov 2013 23:04:03 +0000 (UTC)
commit bd1f55462e9eb4c3594460ff39cbbed588139893
Author: Daniel Sabo <DanielSabo gmail com>
Date: Sun Nov 3 14:53:14 2013 -0800
stretch-contrast: Clean up 1st cl_iter on failure
operations/common/stretch-contrast.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/operations/common/stretch-contrast.c b/operations/common/stretch-contrast.c
index 9094293..8f0b6b3 100644
--- a/operations/common/stretch-contrast.c
+++ b/operations/common/stretch-contrast.c
@@ -319,23 +319,28 @@ cl_process (GeglOperation *operation,
in_format,
GEGL_CL_BUFFER_READ);
- while (gegl_buffer_cl_iterator_next (i, &err))
+ while (gegl_buffer_cl_iterator_next (i, &err) && !err)
{
- if (err) return FALSE;
-
- err = cl_buffer_get_min_max(i->tex[0],
- i->size[0],
- &i->roi[0],
- &i_min,
- &i_max);
- if (err) return FALSE;
+ err = cl_buffer_get_min_max (i->tex[0],
+ i->size[0],
+ &i->roi[0],
+ &i_min,
+ &i_max);
+ if (err)
+ {
+ gegl_buffer_cl_iterator_stop (i);
+ break;
+ }
- if(i_min < min)
+ if (i_min < min)
min = i_min;
- if(i_max > max)
+ if (i_max > max)
max = i_max;
}
+ if (err)
+ return FALSE;
+
diff = max-min;
i = gegl_buffer_cl_iterator_new (output,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]