aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pj_apply_vgridshift.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pj_apply_vgridshift.c b/src/pj_apply_vgridshift.c
index 5b81a26d..35047a19 100644
--- a/src/pj_apply_vgridshift.c
+++ b/src/pj_apply_vgridshift.c
@@ -77,14 +77,18 @@ int pj_apply_vgridshift( PJ *defn, const char *listname,
{
long io = i * point_offset;
LP input;
- int itable;
+ int itable = 0;
double value = HUGE_VAL;
input.phi = y[io];
input.lam = x[io];
+ /* do not deal with NaN coordinates */
+ if( input.phi != input.phi || input.lam != input.lam )
+ itable = *gridlist_count_p;
+
/* keep trying till we find a table that works */
- for( itable = 0; itable < *gridlist_count_p; itable++ )
+ for( ; itable < *gridlist_count_p; itable++ )
{
PJ_GRIDINFO *gi = tables[itable];
struct CTABLE *ct = gi->ct;