Simplified output buffer size formula
@@ -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) {
