aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-06-02Disallow usage of m<0 and n<0 in gn_sinu.Kristian Evers
Negative values of m and n are not valid. Can for certain values of m and n result in zero division. An error is raised at projection setup if m or n is negative. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1836 Credit to OSS-Fuzz.
2017-06-02Merge pull request #520 from QuLogic/macro-deletionKristian Evers
Remove confusing macros.
2017-06-01Fix memory leaks. Fixes ↵Even Rouault
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2000. Credit to OSS Fuzz
2017-06-01Disallow +s=0 when in 4-param. mode.Kristian Evers
Avoids zero-division in PJ_helmert.c Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1956 Credit to OSS-Fuzz.
2017-05-31pj_apply_vgridshift(): avoid integer overflow / read heap-buffer-overflow. ↵Even Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1950. Credit to OSS Fuzz
2017-05-30PJ_ob_tran: avoid infinite recursion on +proj=ob_tran +o_proj=ob_tranEven Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1932 Credit to OSS Fuzz
2017-05-30PJ_ob_tran: fix crash if underlying projection has no fwd methodEven Rouault
For example +proj=ob_tran +o_proj=hgridshift Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1927 Credit to OSS Fuzz
2017-05-30catalog: memory leak and crashes related fixesEven Rouault
* pj_transform() crashes on a catalog that has no matching grid * pj_free() and pj_gc_unloadall() badly interact. No longer try to free the catalog object in pj_free(). That is the job of pj_gc_unloadall() * Fix memory leaks in pj_gc_readcatalog() and pj_gc_unloadall() Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1923 Credit to OSS Fuzz.
2017-05-29PJ_imw_p.c: fix infinite loop in e_inverse() and memory leak.Even Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1873 Credit to OSS Fuzz
2017-05-29PJ_ob_tran.c: fix memory leak in freeup_new() function. Found when running ↵Even Rouault
'make check' on a build with -fsanitize=undefined,address
2017-05-29Fix undefined behaviour on memcpy() when provided with NULL source. Found ↵Even Rouault
when running 'make check' on a build with -fsanitize=undefined,address
2017-05-29pj_compare_datums(): fix null pointer dereference.Even Rouault
Can happen when any of the src/dest projection has a +catalog parameter. Fix a memory leak on catalog_name as well. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1799 Credit to OSS Fuzz
2017-05-28Add commentEven Rouault
2017-05-24Remove confusing macros.Elliott Sales de Andrade
The upper-case macro `VAR` casts the lower-case variable `var` to an expected type, but that usage obfuscates the variables to the casual reader. This is especially prevalent in the allocation function in which `var` is the correct type already, so both `var` and `VAR` are valid *and* in use. In any case, for those functions that don't obtain `var` in the correct type from their parameters, it's much simpler to just case once at the beginning.
2017-05-24Merge pull request #519 from kbevers/avoid-zero-divisionKristian Evers
Handle zero division errors reported by OSS-Fuzz
2017-05-24Avoid zero div. in pj_Convert_Geocentric_To_Geodetic().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1800 Credit to OSS-Fuzz.
2017-05-24Avoid zero division in pj_gauss_ini().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1795 Credit to OSS-Fuzz.
2017-05-24Avoid division by zero in pj_ell_set().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1787 Credit to OSS-Fuzz.
2017-05-24Avoid zero division in PJ_eck3.c s_inverser().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1789 Credit to OSS-Fuzz.
2017-05-24Avoid zero division in PJ_aea.c setup().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1791 Credit to OSS-Fuzz.
2017-05-24Mixed whitespace. Replace tabs with spaces.Kristian Evers
2017-05-24Avoid zero division in pj_init_ctx().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1793 Credit to OSS-Fuzz.
2017-05-23pj_transform(): fix segfault when z == NULL and dest defn has a fwd3dEven Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1794 Credit to OSS Fuzz
2017-05-23pj_open_lib_ex(): protect against write stack buffer overflows.Even Rouault
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1796 Credit to OSS Fuzz
2017-05-23Merge pull request #518 from rouault/fix_ossfuzz_1809Even Rouault
Avoid potentially very long loop when normalizing longitudes around long_wrap_center
2017-05-23Avoid zero division in PJ_stere e_forward().Kristian Evers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1797 Credit to OSS-Fuzz.
2017-05-23Avoid possible zero division in pj_qsfn().Kristian Evers
Fixes https://oss-fuzz.com/v2/testcase-detail/5224053675655168?noredirect=1 Credit to OSS-Fuzz
2017-05-23Fix possible zero division.Kristian Evers
For some extreme values of eccentricity a zero divison can occur. In those rare cases we return HUGE_VAL to indicate something went wrong while still returning a defined value. Credit to OSS Fuzz. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1801
2017-05-23Avoid potentially very long loop when normalizing longitudes around ↵Even Rouault
long_wrap_center Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1809 Credit to OSS Fuzz
2017-05-22PJ_wag3: Fix memory leak of opaque memberEven Rouault
Credit to OSS Fuzz
2017-05-22pj_init(): fix memory leak of pj->geodEven Rouault
Whe PIN = (*proj)(PIN) fails, it doesn't free the geod member. So allocate it afterwards. Credit to OSS Fuzz
2017-05-19Unit conversion pseudo-projection.Kristian Evers
A pseudo-projection that can be used to convert units of input and output data. Primarily useful in pipelines. Unit conversion is performed by means of a pivot unit. The pivot unit for distance units are the meter and for time we use the modified julian date. A time unit conversion is performed like Unit A -> Modified Julian date -> Unit B distance units are converted in the same manner, with meter being the central unit. The modified Julian date is chosen as the pivout unit since it has a fairly high precision, goes sufficiently long backwards in time, has no danger of hitting the upper limit in the near future and it is a fairly common time unit in astronomy and geodesy. Note that we are using the Julian date and not day. The difference being that the latter is defined as an integer and is thus limited to days in resolution. This approach has been extended wherever it makes sense, e.g. the GPS week unit also has a fractional part that makes it possible to determine the day, hour and minute of an observation. In- and output units are controlled with the parameters +xy_in, +xy_out, +z_in, +z_out, +t_in and +t_out where xy denotes horizontal units, z vertical units and t time units. Distance units are converted similar to what is already in use in PROJ.4. To ease usage of the already defined conversion factors a new column with the factors defined as doubles has been added to the pj_units array. This simplifies the code significantly, since parsing the defined strings can be avoided.
2017-05-17Check validity of +n parameter in urm5 projection and fix selftest.Adam Wulkiewicz
2017-05-154-parameter Helmert.Kristian Evers
Completing the Helmert driver with the 4-parameter shift that handles the 2D transformation. The implementation is written in such a way that not only 2D-points but also 3D- and 4D-points can be transformed with the 4-parameter Helmert. The four parameters that can be set in this mode are +x, +y (translations), +s (scale) and +theta (rotation). The presence of the +theta parameter activates the 2D-helmert code, irregardless of the input data's dimensions. The units are meters for the translations as in all the other versions of the Helmert transform. The rotation unit is arcseconds. The units of the scale differ from the 3-, 7- and 14-parameter shift where the unit is ppm. Here it is instead given directly and is as such unitless. The 4-parameter case can also be extended to an 8-parameter shift in the same way as the 7-parameter shift extens to the 14-parameter shift. This might be a bit silly and will probably never be used, but nonetheless, I have included it for the sake of completeness. The rates of change are givens as +dx, +dy, +ds and +dtheta.
2017-05-08Extended Helmert transformation to 14-parametersKristian Evers
Extended Helmert transformation to 14-parameters. This commit extends the Helmert transformationto the fourth dimension and enables spatio-temporal datum shifts in PROJ.4. On top of the usual 7 parameters (+x, +y, +z, +s, +rx, +ry, +rz) the rates of change of the seven parameters can now be used as well. The new parameters are called +dx, +dy, +dx, +ds, +drx, +dry and +drz. To keep track of the datum epoch and coordinate epoch two additional parameters have been added to the Helmert transformation, one of which is mandatory in the 14-parameter case. The mandatory datum epoch is controlled with +epoch (given in YYYY.yyyy format) and the coordinate, or observation, epoch is either controlled in the proj-string with +tobs or by using 4D-coordinates when transformating coordinates with pj_trans(). See the test functions for examples of how to set up the transformation with 14 parameters.
2017-05-02Fixed spelling error: conpute -> computeKristian Evers
2017-05-01Removed unwanted call to pj_log_level().Kristian Evers
When running the self-test with logging was turned off globally when the PJ_cart test was run. As a consequence all test functions called after PJ_cart was not able to output debugging information. In most cases this would go by unnoticed but when calling proj with PROJ_DEBUG=1 (or higher) all debugging output whould get suppressed. This commit removes the call to pj_log_level that turns of debugging output in the self-test.
2017-04-18Fix aea projection return value in case of error (#503)maximchurilin
2017-04-10geodesic.h: Switch to geodesic version 1.48.1.Charles Karney
2017-04-10geodesic.c: fix compiler error, if (x) -> if (x != 0)Charles Karney
2017-04-09Merge is geodesic routines from GeographicLib 1.48. Changes:Charles Karney
- http://geographiclib.sf.net -> http://geographiclib.sourceforge.io - backport fixes for warnings messages from some compilers - change default range for longitude and azimuth to (-180d, 180d] (instead of [-180d, 180d))
2017-03-27Horisontal and vertical gridshift driversKristian Evers
Until now gridshifts has not been working with the new API in proj.h since parsing of +nadgrids and +geoidgrids is build into pj_transform(). This commit introduces the possibility to do both horizontal and vertical gridshift with the pipeline API. The vgridshift and hgridshift kernels are simple wrappers for pj_apply_gridshift3() and pj_apply_vgridshift() that are also used by pj_transform(). Introduced in PR #492.
2017-03-16Add pj_find_file() function to retrieve the full filename of a proj resource ↵Even Rouault
file. Will help GDAL finding where +nadgrids=... or +geoidgrids=... resouces are located to be able to directly open them.
2017-03-15Document messy GDAL hackEven Rouault
2017-03-08fix memory leak in PJ_ob_tran.c (in freeup_new)dusanjovic
freeup_new must not return before both P->opaque and P are deallocated.
2017-03-08Fix commentEven Rouault
2017-02-28Enable cppcheck and fix related mostly false-positive warningsEven Rouault
2017-02-27test228.c: remove unused arguments in main()Even Rouault
2017-02-27Merge pull request #487 from PositiveArrow/c11_compilationEven Rouault
C11 compilation
2017-02-27Merge pull request #495 from rouault/misc_warning_fixesEven Rouault
Fix warnings related to -Wshadow -Wnull-dereference -Wfloat-conversion -Wmissing-prototypes -Wmissing-declarations