ECC-1639: CRASH: Nearest neighbour on Gaussian grid with N=0

This commit is contained in:
Shahram Najm 2023-07-16 15:05:07 +01:00
parent b8d6097b8b
commit 6aaf499d13
2 changed files with 3 additions and 1 deletions

View File

@ -4003,6 +4003,8 @@ static int ecc_grib_get_gaussian_latitudes(long trunc, double* lats)
int grib_get_gaussian_latitudes(long trunc, double* lats) int grib_get_gaussian_latitudes(long trunc, double* lats)
{ {
if (trunc == 0)
return GRIB_GEOCALCULUS_PROBLEM;
if (trunc == 1280) if (trunc == 1280)
return get_precomputed_latitudes_N1280(lats); return get_precomputed_latitudes_N1280(lats);
if (trunc == 640) if (trunc == 640)

View File

@ -129,7 +129,7 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args)
ret = grib_get_gaussian_latitudes(trunc, lats); ret = grib_get_gaussian_latitudes(trunc, lats);
if (ret != GRIB_SUCCESS) { if (ret != GRIB_SUCCESS) {
grib_context_log(h->context, GRIB_LOG_ERROR, "error %d calculating gaussian points", ret); grib_context_log(h->context, GRIB_LOG_ERROR, "Error calculating gaussian points: %s", grib_get_error_message(ret));
return ret; return ret;
} }
/* /*