From f056a5c8cdb6012d97d04a61ab81ccf95d934b40 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Wed, 17 Apr 2024 14:41:28 +0200
Subject: [PATCH] Fix bug triggered by the guess option from the cmp_tool when
 compressing icu_compress_data with a compressed data buffer equal to NULL.

is was trigert by the guess option form the cmp_tool
---
 lib/icu_compress/cmp_icu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/icu_compress/cmp_icu.c b/lib/icu_compress/cmp_icu.c
index b610991..45554bf 100644
--- a/lib/icu_compress/cmp_icu.c
+++ b/lib/icu_compress/cmp_icu.c
@@ -2265,7 +2265,7 @@ int icu_compress_data(const struct cmp_cfg *cfg)
 			return 0;
 		cfg_cpy = *cfg;
 		cfg_cpy.buffer_length = cmp_cal_size_of_data(cfg->buffer_length, cfg->data_type);
-		if (!cfg_cpy.buffer_length)
+		if (cfg_cpy.icu_output_buf && !cfg_cpy.buffer_length)
 			return -1;
 
 		if (!rdcu_supported_data_type_is_used(cfg->data_type) && !cmp_data_type_is_invalid(cfg->data_type)) {
-- 
GitLab