[goffice] Don't crash when no valid data is available. [#684047]
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Don't crash when no valid data is available. [#684047]
- Date: Sat, 15 Sep 2012 06:48:55 +0000 (UTC)
commit 6f2f18010e18aa0084a17e1431d7ae042d8e36f1
Author: Jean Brefort <jean brefort normalesup org>
Date: Sat Sep 15 08:46:10 2012 +0200
Don't crash when no valid data is available. [#684047]
ChangeLog | 6 ++++++
plugins/plot_distrib/gog-histogram.c | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f266c5a..9677d16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-15 Jean Brefort <jean brefort normalesup org>
+
+ * plugins/plot_distrib/gog-histogram.c
+ (gog_histogram_plot_series_update): don't crash when no valid data is
+ available. [#684047]
+
2012-09-13 Jean Brefort <jean brefort normalesup org>
* plugins/plot_xy/Makefile.am: add XYMinMax plot. [#683493]
diff --git a/plugins/plot_distrib/gog-histogram.c b/plugins/plot_distrib/gog-histogram.c
index 604b11b..987e67c 100644
--- a/plugins/plot_distrib/gog-histogram.c
+++ b/plugins/plot_distrib/gog-histogram.c
@@ -987,6 +987,7 @@ gog_histogram_plot_series_update (GogObject *obj)
}
if (width > 0. && (y || y_)) {
double m, M;
+ /* ignore nans */
if (y) {
m = (y_)? (MIN (y[0], y_[0])): y[0];
M = (y_)? (MAX (y[y_len-1], y_[y__len-1])): y[y_len-1];
@@ -994,6 +995,8 @@ gog_histogram_plot_series_update (GogObject *obj)
m = y_[0];
M = y_[y__len-1];
}
+ if (!go_finite (m) || !go_finite (M))
+ return;
/* round m */
m = floor ((m - origin)/ width) * width + origin;
x_len = ceil ((M - m) / width) + 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]