diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 7378aabe2..7bdad0c52 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -511,7 +511,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) grib_context_log(a->context, GRIB_LOG_DEBUG,"CCSDS pack_double: packing %s, %d values", a->name, n_vals); /*ECC-1431: GRIB2: CCSDS encoding failure AEC_STREAM_ERROR*/ - buflen = buflen * 67.0/64 + 257; + buflen += buflen / 20 + 256; buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); if (!buf) {