aboutsummaryrefslogtreecommitdiff
path: root/src/hrs-scaling.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-02-03 11:39:56 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:13 +0100
commit2e40558cc8e2a449af7822acb9eba960232048eb (patch)
treea4ae1672c40fa35ec0d2aaab56f19e7f587b0086 /src/hrs-scaling.c
parentf9971c54d21ea76d5dd8b77f59a3efdef7071f2c (diff)
Don't check the uninitialised intensity if the peak isn't valid
Diffstat (limited to 'src/hrs-scaling.c')
-rw-r--r--src/hrs-scaling.c6
1 files 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;