...
 
Commits (2)
libgeotiff (1.5.1-1~exp2) experimental; urgency=medium
* Add upstream patches to fix test failures.
-- Bas Couwenberg <sebastic@debian.org> Tue, 02 Apr 2019 06:58:24 +0200
libgeotiff (1.5.1-1~exp1) experimental; urgency=medium
* New upstream release.
......
Description: GTIFDecToDMS(): avoid invalid double->int cast on invalid coordinates
Author: Even Rouault <even.rouault@spatialys.com>
Origin: https://github.com/OSGeo/libgeotiff/commit/4b41ca6ce332f0c21504c2da3da850275d9da5ae
Bug: https://github.com/OSGeo/libgeotiff/issues/16
--- a/bin/listgeo.c
+++ b/bin/listgeo.c
@@ -198,8 +198,16 @@ static int GTIFReportACorner( GTIF *gtif
}
else
{
- fprintf( fp_out, " (%s,", GTIFDecToDMS( x, "Long", 2 ) );
- fprintf( fp_out, "%s)", GTIFDecToDMS( y, "Lat", 2 ) );
+ const char* pszLong = GTIFDecToDMS( x, "Long", 2 );
+ if( pszLong[0] == 0 )
+ {
+ fprintf( fp_out, " (invalid)" );
+ }
+ else
+ {
+ fprintf( fp_out, " (%s,", pszLong );
+ fprintf( fp_out, "%s)", GTIFDecToDMS( y, "Lat", 2 ) );
+ }
}
}
--- a/geo_normalize.c
+++ b/geo_normalize.c
@@ -2721,6 +2721,9 @@ const char *GTIFDecToDMS( double dfAngle
double dfRound;
int i;
+ if( !(dfAngle >= -360 && dfAngle <= 360) )
+ return "";
+
dfRound = 0.5/60;
for( i = 0; i < nPrecision; i++ )
dfRound = dfRound * 0.1;
--- a/test/testlistgeo_out.dist
+++ b/test/testlistgeo_out.dist
@@ -221,11 +221,11 @@ Prime Meridian: 8901/Greenwich (0.000000
Projection Linear Units: 9036/kilometre (1000.000000m)
Corner Coordinates:
-Upper Left ( 440720.000, 3751320.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N)
-Lower Left ( 440720.000, 3751260.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N)
-Upper Right ( 440780.000, 3751320.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N)
-Lower Right ( 440780.000, 3751260.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N)
-Center ( 440750.000, 3751290.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N)
+Upper Left ( 440720.000, 3751320.000) (invalid)
+Lower Left ( 440720.000, 3751260.000) (invalid)
+Upper Right ( 440780.000, 3751320.000) (invalid)
+Lower Right ( 440780.000, 3751260.000) (invalid)
+Center ( 440750.000, 3751290.000) (invalid)
Testing listgeo ../test/data/ProjectedCSTypeGeoKey_28191_cassini_soldner.tif
Geotiff_Information:
Description: GTIFDecToDMS(): fix rounding issue
Author: Even Rouault <even.rouault@spatialys.com>
Origin https://github.com/OSGeo/libgeotiff/commit/7cb9b68ea72fb2a6023bb98796fd3ba6dc7b64a1
Bug: https://github.com/OSGeo/libgeotiff/issues/16
--- a/geo_normalize.c
+++ b/geo_normalize.c
@@ -2727,6 +2727,11 @@ const char *GTIFDecToDMS( double dfAngle
nDegrees = (int) ABS(dfAngle);
nMinutes = (int) ((ABS(dfAngle) - nDegrees) * 60 + dfRound);
+ if( nMinutes == 60 )
+ {
+ nDegrees ++;
+ nMinutes = 0;
+ }
dfSeconds = ABS((ABS(dfAngle) * 3600 - nDegrees*3600 - nMinutes*60));
if( EQUAL(pszAxis,"Long") && dfAngle < 0.0 )
--- a/test/testlistgeo_out.dist
+++ b/test/testlistgeo_out.dist
@@ -1429,7 +1429,7 @@ PCS = 2046 (Hartebeesthoek94 / Lo15)
Projection = 17515 (South African Survey Grid zone 15)
Projection Method: CT_TransvMercator_SouthOrientated
ProjNatOriginLatGeoKey: 0.000000 ( 0d 0' 0.00"N)
- ProjNatOriginLongGeoKey: 15.000000 ( 14d60' 0.00"E)
+ ProjNatOriginLongGeoKey: 15.000000 ( 15d 0' 0.00"E)
ProjScaleAtNatOriginGeoKey: 1.000000
ProjFalseEastingGeoKey: 0.000000 m
ProjFalseNorthingGeoKey: 0.000000 m
@@ -1791,7 +1791,7 @@ Geotiff_Information:
PCS = 3410 (NSIDC EASE-Grid Global)
Projection = 19869 (US NSIDC Equal Area global projection)
Projection Method: CT_CylindricalEqualArea
- ProjStdParallel1GeoKey: 30.000000 ( 29d60' 0.00"N)
+ ProjStdParallel1GeoKey: 30.000000 ( 30d 0' 0.00"N)
ProjNatOriginLongGeoKey: 0.000000 ( 0d 0' 0.00"E)
ProjFalseEastingGeoKey: 0.000000 m
ProjFalseNorthingGeoKey: 0.000000 m
0001-GTIFDecToDMS-fix-rounding-issue-refs-16.patch
0001-GTIFDecToDMS-avoid-invalid-double-int-cast-on-invali.patch