diff options
| author | Andrew Bell <andrew.bell.ia@gmail.com> | 2019-05-15 10:47:03 -0400 |
|---|---|---|
| committer | Andrew Bell <andrew.bell.ia@gmail.com> | 2019-05-15 10:47:03 -0400 |
| commit | 8f268409d37cea329d263e177b83e42f8384d3c7 (patch) | |
| tree | c4d0f3dd19456600f718a6e0c8573577f433549b /src/projections/ob_tran.cpp | |
| parent | 886ced02f0aaab5d66d16459435f7447cf976650 (diff) | |
| parent | d67203a6f76a74f5ac029ff052dbcc72e3b59624 (diff) | |
| download | PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.tar.gz PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/projections/ob_tran.cpp')
| -rw-r--r-- | src/projections/ob_tran.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/projections/ob_tran.cpp b/src/projections/ob_tran.cpp index 6daae394..f9eaa6f0 100644 --- a/src/projections/ob_tran.cpp +++ b/src/projections/ob_tran.cpp @@ -154,6 +154,11 @@ static ARGS ob_tran_target_params (paralist *params) { if (0!=strncmp (args.argv[i], "o_proj=", 7)) continue; args.argv[i] += 2; + if (strcmp(args.argv[i], "proj=ob_tran") == 0 ) { + pj_dealloc (args.argv); + args.argc = 0; + args.argv = nullptr; + } break; } @@ -164,7 +169,6 @@ static ARGS ob_tran_target_params (paralist *params) { PJ *PROJECTION(ob_tran) { double phip; - char *name; ARGS args; PJ *R; /* projection to rotate */ @@ -176,15 +180,15 @@ PJ *PROJECTION(ob_tran) { P->destructor = destructor; /* get name of projection to be translated */ - if (!(name = pj_param(P->ctx, P->params, "so_proj").s)) + if (pj_param(P->ctx, P->params, "so_proj").s == nullptr) return destructor(P, PJD_ERR_NO_ROTATION_PROJ); - /* avoid endless recursion */ - if( strcmp(name, "ob_tran") == 0 ) - return destructor(P, PJD_ERR_FAILED_TO_FIND_PROJ); - /* Create the target projection object to rotate */ args = ob_tran_target_params (P->params); + /* avoid endless recursion */ + if (args.argv == nullptr ) { + return destructor(P, PJD_ERR_FAILED_TO_FIND_PROJ); + } R = pj_init_ctx (pj_get_ctx(P), args.argc, args.argv); pj_dealloc (args.argv); |
