aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-08-18 17:30:18 +0200
committerThomas White <taw@physics.org>2020-08-18 17:30:18 +0200
commit09a1a42dc6e17a330bdd2600d6204f95b4119f76 (patch)
tree62426d6b086157308edee9f169e5b4a9c64828f2
parent73490048c848278397672f9e97cf1d1c085a0e8a (diff)
predict-refine: Remove out-of-bounds GSL vector access
We got away with this because the GSL error handler is turned off in indexamjig.c, and invalid accesses are defined to return 0. However, these accesses should have been removed when the clen refinement was disabled in predict-refine
-rw-r--r--libcrystfel/src/predict-refine.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index 17194fbf..a9ba6966 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -495,12 +495,13 @@ static int iterate(struct reflpeak *rps, int n, UnitCell *cell,
csx += gsl_vector_get(shifts, 6);
csy += gsl_vector_get(shifts, 7);
csz += gsl_vector_get(shifts, 8);
- update_detector(image->detgeom, gsl_vector_get(shifts, 9),
- gsl_vector_get(shifts, 10),
- gsl_vector_get(shifts, 11));
+ update_detector(image->detgeom,
+ gsl_vector_get(shifts, 9),
+ gsl_vector_get(shifts, 10),
+ 0.0);
*total_x += gsl_vector_get(shifts, 9);
*total_y += gsl_vector_get(shifts, 10);
- *total_z += gsl_vector_get(shifts, 11);
+ *total_z += 0.0;
cell_set_reciprocal(cell, asx, asy, asz, bsx, bsy, bsz, csx, csy, csz);