diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-26 14:30:33 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-03-26 14:30:33 +0100 |
| commit | 63224ed0e81b0e5795610c10e44578c932bbc33b (patch) | |
| tree | a4a26cf931d63cf48f51c6dc6ca028f36cd85cca /src/apply_vgridshift.cpp | |
| parent | a53f81de2f5fc5a6366dfea3806f4062abca4ecf (diff) | |
| download | PROJ-63224ed0e81b0e5795610c10e44578c932bbc33b.tar.gz PROJ-63224ed0e81b0e5795610c10e44578c932bbc33b.zip | |
read_vgrid_value(): make it clear that nullptr deref of ct->cvs cannot happen. Coverity CID 193525
Diffstat (limited to 'src/apply_vgridshift.cpp')
| -rw-r--r-- | src/apply_vgridshift.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/apply_vgridshift.cpp b/src/apply_vgridshift.cpp index ae23e39a..9be65f08 100644 --- a/src/apply_vgridshift.cpp +++ b/src/apply_vgridshift.cpp @@ -98,10 +98,13 @@ static double read_vgrid_value( PJ *defn, PJ_LP input, double vmultiplier, int * } /* load the grid shift info if we don't have it. */ - if( ct->cvs == nullptr && !pj_gridinfo_load( pj_get_ctx(defn), gi ) ) + if( ct->cvs == nullptr ) { - pj_ctx_set_errno( defn->ctx, PJD_ERR_FAILED_TO_LOAD_GRID ); - return PJD_ERR_FAILED_TO_LOAD_GRID; + if( !pj_gridinfo_load( pj_get_ctx(defn), gi ) || ct->cvs == nullptr ) + { + pj_ctx_set_errno( defn->ctx, PJD_ERR_FAILED_TO_LOAD_GRID ); + return PJD_ERR_FAILED_TO_LOAD_GRID; + } } |
