aboutsummaryrefslogtreecommitdiff
path: root/src/geodesic.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-03-12 23:32:03 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-03-14 20:25:12 +0100
commita49738902a27624d835e5a6b9983a9803c322996 (patch)
tree8f0a7e5302e12ee0b3044a7b87ca2de6bbdfbc27 /src/geodesic.c
parentcde489ce64556e0ad5fa5da64bcb8fd88aee4c39 (diff)
downloadPROJ-a49738902a27624d835e5a6b9983a9803c322996.tar.gz
PROJ-a49738902a27624d835e5a6b9983a9803c322996.zip
Fix (mostly false positive) clang static analyzer warnings about potential null pointer dereference
Diffstat (limited to 'src/geodesic.c')
-rw-r--r--src/geodesic.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/geodesic.c b/src/geodesic.c
index 5121ea98..40dffbc1 100644
--- a/src/geodesic.c
+++ b/src/geodesic.c
@@ -658,21 +658,21 @@ real geod_genposition(const struct geod_geodesicline* l,
S12 = l->c2 * atan2(salp12, calp12) + l->A4 * (B42 - l->B41);
}
- if (outmask & GEOD_LATITUDE)
+ if ((outmask & GEOD_LATITUDE) && plat2)
*plat2 = lat2;
- if (outmask & GEOD_LONGITUDE)
+ if ((outmask & GEOD_LONGITUDE) && plon2)
*plon2 = lon2;
- if (outmask & GEOD_AZIMUTH)
+ if ((outmask & GEOD_AZIMUTH) && pazi2)
*pazi2 = azi2;
- if (outmask & GEOD_DISTANCE)
+ if ((outmask & GEOD_DISTANCE) && ps12)
*ps12 = s12;
- if (outmask & GEOD_REDUCEDLENGTH)
+ if ((outmask & GEOD_REDUCEDLENGTH) && pm12)
*pm12 = m12;
if (outmask & GEOD_GEODESICSCALE) {
if (pM12) *pM12 = M12;
if (pM21) *pM21 = M21;
}
- if (outmask & GEOD_AREA)
+ if ((outmask & GEOD_AREA) && pS12)
*pS12 = S12;
return (flags & GEOD_ARCMODE) ? s12_a12 : sig12 / degree;