From b90be2fe668bc312f0a0e080eaf2c7fa4c12e83e Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sat, 1 Nov 2003 13:16:02 +0000 Subject: [PATCH] forgot to also add a range check here. 2003-11-01 Sven Neumann * app/base/gimphistogram.c (gimp_histogram_get_mean): forgot to also add a range check here. * app/widgets/gimphistogrameditor.c: update the channel menu when the image mode changes or an alpha channel is added/removed. --- ChangeLog | 10 +++++++++- NEWS | 5 ++++- app/base/gimphistogram.c | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8eb3b56b3..9de122ffbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-11-01 Sven Neumann + + * app/base/gimphistogram.c (gimp_histogram_get_mean): forgot to + also add a range check here. + + * app/widgets/gimphistogrameditor.c: update the channel menu when + the image mode changes or an alpha channel is added/removed. + 2003-11-01 Sven Neumann Replaced the histogram tool by a histogram dialog: @@ -6,7 +14,7 @@ * themes/Default/images/tools/stock-tool-histogram-[16|22].png: removed here ... - * themes/Default/images/stock-histogram-[16|22].png: ,,, and added + * themes/Default/images/stock-histogram-[16|22].png: ... and added under these new names. * libgimpwidgets/gimpstock.[ch]: register the icons as diff --git a/NEWS b/NEWS index 0c14b7e1b0..c010c89947 100644 --- a/NEWS +++ b/NEWS @@ -10,9 +10,12 @@ GIMP version 2.0. Overview of Changes in GIMP 1.3.22 ================================== +- Replaced histogram tool with a histogram dialog [Sven] +- Multi-head safety [Sven] +- Changes for future compatibility of text layers [Sven] - Histogram scale configurable for all tools and defaults to linear [Sven] - Better default settings -- Complete configurability of normal and fullscreen view [Sven, Bolsh] +- Completed configurability of normal and fullscreen view [Sven, Bolsh] - GimpConfig cleanups and improvements [Mitch, Sven] - Allow to configure the default grid in your gimprc [Brix] - Improved session handling; store more settings like the position of diff --git a/app/base/gimphistogram.c b/app/base/gimphistogram.c index e9a25023d3..d3a7414776 100644 --- a/app/base/gimphistogram.c +++ b/app/base/gimphistogram.c @@ -253,7 +253,7 @@ gimp_histogram_get_mean (GimpHistogram *histogram, g_return_val_if_fail (histogram != NULL, 0.0); - if (! histogram->values) + if (! histogram->values || channel >= histogram->n_channels) return 0.0; for (i = start; i <= end; i++) @@ -341,7 +341,7 @@ gimp_histogram_alloc_values (GimpHistogram *histogram, histogram->values = g_new0 (gdouble *, histogram->n_channels); for (i = 0; i < histogram->n_channels; i++) - histogram->values[i] = g_new (double, 256); + histogram->values[i] = g_new (gdouble, 256); } }