[gimp] app: CLAMP(bits, 1, 16) in gimp_gegl_apply_color_reduction()



commit ab5a27d74a14315bca1cc65b572de3c546100957
Author: Michael Natterer <mitch gimp org>
Date:   Wed Nov 9 12:33:13 2016 +0100

    app: CLAMP(bits, 1, 16) in gimp_gegl_apply_color_reduction()
    
    which is the range of the GEGL op's properties.

 app/gegl/gimp-gegl-apply-operation.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-apply-operation.c b/app/gegl/gimp-gegl-apply-operation.c
index 41440d7..0688b9e 100644
--- a/app/gegl/gimp-gegl-apply-operation.c
+++ b/app/gegl/gimp-gegl-apply-operation.c
@@ -284,6 +284,8 @@ gimp_gegl_apply_color_reduction (GeglBuffer   *src_buffer,
   g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
   g_return_if_fail (GEGL_IS_BUFFER (dest_buffer));
 
+  bits = CLAMP (bits, 1, 16);
+
   node = gegl_node_new_child (NULL,
                               "operation",     "gegl:color-reduction",
                               "red-bits",      bits,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]