aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hrs-scaling.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index cbd54ee5..1d11e402 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -325,10 +325,18 @@ static double iterate_scale(struct image *images, int n,
} else {
shifts = gsl_vector_alloc(n);
for ( frame=0; frame<n; frame++ ) {
- double num, den;
+
+ double num, den, sh;
+
num = gsl_vector_get(v, frame);
den = gsl_matrix_get(M, frame, frame);
- gsl_vector_set(shifts, frame, num/den);
+ sh = num/den;
+
+ if ( isnan(sh) ) {
+ gsl_vector_set(shifts, frame, 0.0);
+ } else {
+ gsl_vector_set(shifts, frame, sh);
+ }
}
}