Valgrind error: statistics for a field with all missing values
@@ -197,6 +197,10 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
if (missingValuesPresent) {
i=0;
while (i<size && values[i] == missing) {i++;number_of_missing++;}
+ if (number_of_missing == size) {
+ /* ECC-649: All values are missing */
+ min = max = avg = missing;
+ } else {
max=values[i];
min=values[i];
avg=values[i];
@@ -207,6 +211,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
if (value != missing) avg+=value;
else number_of_missing++;
}
+ }
} else {
max=values[0];
min=values[0];
