diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc index bd1c2abd1..2e33a0b50 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -808,6 +808,13 @@ int grib_accessor_data_g22order_packing_t::pack_double(const double* val, size_t if ((err = grib_get_long_internal(gh, bits_per_value_, &bits_per_value)) != GRIB_SUCCESS) return err; + + // ECC-1968: For bits_per_value > 23, the complex packing algorithm may use more than 25 bits per value. + // However, this exceeds the maximum number of bits for the packing algorithm. + if (bits_per_value > 23) { + bits_per_value = 23; + } + if ((err = grib_get_long_internal(gh, decimal_scale_factor_, &decimal_scale_factor)) != GRIB_SUCCESS) return err; @@ -1463,7 +1470,7 @@ template int grib_accessor_data_g22order_packing_t::unpack(T* val, size_t* len) { static_assert(std::is_floating_point::value, "Requires floating points numbers"); - grib_handle* gh = grib_handle_of_accessor(this); + grib_handle* gh = grib_handle_of_accessor(this); size_t i = 0; size_t j = 0; diff --git a/src/action_class_when.cc b/src/action_class_when.cc index a2a770e7f..a8af5bad4 100644 --- a/src/action_class_when.cc +++ b/src/action_class_when.cc @@ -188,8 +188,8 @@ static int notify_change(grib_action* a, grib_accessor* observer, grib_accessor* #ifdef CHECK_LOOP if (self->loop) { printf("LOOP detected...\n"); - printf("WHEN triggered by %s %ld\n", observed->name, lres); - grib_expression_print(observed->context, self->expression, 0, stderr); + printf("WHEN triggered by %s %ld\n", observed->name_, lres); + grib_expression_print(observed->context_, self->expression, 0, stderr); fprintf(stderr, "\n"); return ret; }