From 90875d7616facf04a1836be833fb810142f3d8e1 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Dec 2019 10:45:20 +0100 Subject: Modify verbosity level of some debug/trace messages - unitconvert, ell_set and helmert were using debug level, which is too verbose. Using trace instead - proj_trans() was using trace to indicate the operation it selects. Changing it to debug --- src/conversions/unitconvert.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/conversions/unitconvert.cpp') diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp index 377f384e..8472355d 100644 --- a/src/conversions/unitconvert.cpp +++ b/src/conversions/unitconvert.cpp @@ -470,7 +470,7 @@ PJ *CONVERSION(unitconvert,0) { const char* normalized_name = nullptr; f = get_unit_conversion_factor(name, &xy_in_is_linear, &normalized_name); if (f != 0.0) { - proj_log_debug(P, "xy_in unit: %s", normalized_name); + proj_log_trace(P, "xy_in unit: %s", normalized_name); } else { f = pj_param (P->ctx, P->params, "dxy_in").f; if (f == 0.0 || 1.0 / f == 0.0) @@ -485,7 +485,7 @@ PJ *CONVERSION(unitconvert,0) { const char* normalized_name = nullptr; f = get_unit_conversion_factor(name, &xy_out_is_linear, &normalized_name); if (f != 0.0) { - proj_log_debug(P, "xy_out unit: %s", normalized_name); + proj_log_trace(P, "xy_out unit: %s", normalized_name); } else { f = pj_param (P->ctx, P->params, "dxy_out").f; if (f == 0.0 || 1.0 / f == 0.0) @@ -506,7 +506,7 @@ PJ *CONVERSION(unitconvert,0) { const char* normalized_name = nullptr; f = get_unit_conversion_factor(name, &z_in_is_linear, &normalized_name); if (f != 0.0) { - proj_log_debug(P, "z_in unit: %s", normalized_name); + proj_log_trace(P, "z_in unit: %s", normalized_name); } else { f = pj_param (P->ctx, P->params, "dz_in").f; if (f == 0.0 || 1.0 / f == 0.0) @@ -519,7 +519,7 @@ PJ *CONVERSION(unitconvert,0) { const char* normalized_name = nullptr; f = get_unit_conversion_factor(name, &z_out_is_linear, &normalized_name); if (f != 0.0) { - proj_log_debug(P, "z_out unit: %s", normalized_name); + proj_log_trace(P, "z_out unit: %s", normalized_name); } else { f = pj_param (P->ctx, P->params, "dz_out").f; if (f == 0.0 || 1.0 / f == 0.0) @@ -540,7 +540,7 @@ PJ *CONVERSION(unitconvert,0) { if (!s) return pj_default_destructor(P, PJD_ERR_UNKNOWN_UNIT_ID); /* unknown unit conversion id */ Q->t_in_id = i; - proj_log_debug(P, "t_in unit: %s", time_units[i].name); + proj_log_trace(P, "t_in unit: %s", time_units[i].name); } s = nullptr; @@ -550,7 +550,7 @@ PJ *CONVERSION(unitconvert,0) { if (!s) return pj_default_destructor(P, PJD_ERR_UNKNOWN_UNIT_ID); /* unknown unit conversion id */ Q->t_out_id = i; - proj_log_debug(P, "t_out unit: %s", time_units[i].name); + proj_log_trace(P, "t_out unit: %s", time_units[i].name); } return P; -- cgit v1.2.3 From 3f3af95e0a7f421c84617ce21a2bae1c01368397 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 13 Jan 2020 18:09:35 +0100 Subject: unitconvert with mjd time format: avoid potential integer overflow Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20072 --- src/conversions/unitconvert.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conversions/unitconvert.cpp') diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp index 8472355d..f8439aee 100644 --- a/src/conversions/unitconvert.cpp +++ b/src/conversions/unitconvert.cpp @@ -164,7 +164,8 @@ static double decimalyear_to_mjd(double decimalyear) { double fractional_year; double mjd; - if( decimalyear < -10000 || decimalyear > 10000 ) + // Written this way to deal with NaN input + if( !(decimalyear >= -10000 && decimalyear <= 10000) ) return 0; year = lround(floor(decimalyear)); -- cgit v1.2.3