diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/diffraction.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/diffraction.c b/src/diffraction.c index 29e30431..93ac7f8e 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -229,7 +229,10 @@ static double molecule_factor(const double *intensities,const double *phases, h = (signed int)rint(hd); k = (signed int)rint(kd); l = (signed int)rint(ld); - r = lookup_intensity(intensities, h, k, l); + if ( abs(h) > INDMAX ) r = 0.0; + else if ( abs(k) > INDMAX ) r = 0.0; + else if ( abs(l) > INDMAX ) r = 0.0; + else r = lookup_intensity(intensities, h, k, l); break; case GRADIENT_INTERPOLATE : r = interpolate_intensity(intensities, hd, kd, ld); |