From 65b952d9d99f1a6b3ecf353f6725065b616f5609 Mon Sep 17 00:00:00 2001 From: Alexandra Tolstikova Date: Thu, 9 Jul 2015 14:15:53 +0200 Subject: Temporary fix of infinite loop bug in asdf_reduce_cell() --- libcrystfel/src/asdf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcrystfel/src/asdf.c b/libcrystfel/src/asdf.c index df6d7500..132db47d 100644 --- a/libcrystfel/src/asdf.c +++ b/libcrystfel/src/asdf.c @@ -597,7 +597,10 @@ static int reduce_asdf_cell(struct asdf_cell *cl) gsl_vector *vc = gsl_vector_alloc(3); int changed = 1; + + int n = 0; while ( changed ) { + n += 1; changed = 0; gsl_vector_memcpy(va, cl->axes[0]); @@ -688,6 +691,8 @@ static int reduce_asdf_cell(struct asdf_cell *cl) changed = 1; } } + + if (n > 30) changed = 0; } cross_product(cl->axes[0], cl->axes[1], &vc); -- cgit v1.2.3