From 2e40558cc8e2a449af7822acb9eba960232048eb Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 3 Feb 2011 11:39:56 +0100 Subject: Don't check the uninitialised intensity if the peak isn't valid --- src/hrs-scaling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c index cc27e76d..8e17bee7 100644 --- a/src/hrs-scaling.c +++ b/src/hrs-scaling.c @@ -385,9 +385,11 @@ double *scale_intensities(struct image *images, int n, const char *sym, int scalable = 1; if ( images[m].cpeaks[j].p < 0.1 ) scalable = 0; - if ( !images[m].cpeaks[j].valid ) scalable = 0; - if ( fabs(images[m].cpeaks[j].intensity) < 0.1 ) { + if ( !images[m].cpeaks[j].valid ) { scalable = 0; + } else { + double v = fabs(images[m].cpeaks[j].intensity); + if ( v < 0.1 ) scalable = 0; } images[m].cpeaks[j].scalable = scalable; -- cgit v1.2.3