[gimp] fix NaN issue in gimpoperationlevels.c
- From: Simon Budig <simon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] fix NaN issue in gimpoperationlevels.c
- Date: Wed, 9 May 2012 00:24:56 +0000 (UTC)
commit 8482fb9cf65c11f6fbef85ae84be9cab804bd444
Author: Simon Budig <simon budig de>
Date: Wed May 9 02:24:12 2012 +0200
fix NaN issue in gimpoperationlevels.c
app/gegl/gimpoperationlevels.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/app/gegl/gimpoperationlevels.c b/app/gegl/gimpoperationlevels.c
index f36f3e77..7bd25f9 100644
--- a/app/gegl/gimpoperationlevels.c
+++ b/app/gegl/gimpoperationlevels.c
@@ -86,6 +86,9 @@ gimp_operation_levels_map (gdouble value,
gdouble low_output,
gdouble high_output)
{
+ /* clamp to guard pow() against negative input */
+ value = MAX (value, low_input);
+
/* determine input intensity */
if (high_input != low_input)
value = (value - low_input) / (high_input - low_input);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]