[goffice] logfit: fix problem with missing y_vals.



commit 7566996bbde6c7298f13279985109b6417cee479
Author: Morten Welinder <terra gnome org>
Date:   Wed Jul 8 18:20:50 2015 -0400

    logfit: fix problem with missing y_vals.

 ChangeLog                       |    5 +++++
 NEWS                            |    1 +
 plugins/reg_logfit/gog-logfit.c |    2 +-
 3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d9c8046..f2c93b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-08  Morten Welinder  <terra gnome org>
+
+       * plugins/reg_logfit/gog-logfit.c (gog_log_fit_curve_update):
+       Survive missing y_val.  Fixes Redhat #1240470.
+
 2015-07-04  Jean Brefort  <jean brefort normalesup org>
 
        * goffice/graph/gog-object.c (gog_object_document_changed): check args
diff --git a/NEWS b/NEWS
index 723f8f2..6a25421 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Morten:
        * Plug leaks.  [#749395]
        * Portability problem affecting macs.  [#749463]
        * Fuzzed file fixes.  [#750047]  [#751250]
+       * Fix log-fit problem.  [Redhat #1240470]
 
 --------------------------------------------------------------------------
 goffice 0.10.22:
diff --git a/plugins/reg_logfit/gog-logfit.c b/plugins/reg_logfit/gog-logfit.c
index 445af9a..7230b45 100644
--- a/plugins/reg_logfit/gog-logfit.c
+++ b/plugins/reg_logfit/gog-logfit.c
@@ -51,7 +51,7 @@ gog_log_fit_curve_update (GogObject *obj)
                ty_vals = g_new (double, nb);
                for (i = 0, used = 0; i < nb; i++) {
                        x = (x_vals)? x_vals[i]: i;
-                       y = y_vals[i];
+                       y = y_vals ? y_vals[i] : go_nan;
                        if (!go_finite (x) || !go_finite (y)) {
                                if (rc->skip_invalid)
                                        continue;


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