From 2286a5938face9c60bae505d24c9fa24074c91f0 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Tue, 25 Apr 2023 12:28:11 +0200
Subject: [PATCH] Fixed an error when using the last_info option that caused
 the model to be set to zero

---
 CHANGELOG.md | 2 +-
 cmp_tool.c   | 4 ++++
 meson.build  | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 883d182..dd2361d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,7 +18,7 @@ All notable changes to this project will be documented in this file.
 - remove memory leaks from tests
 - fixed incorrect error message when using rdcu_pkt option without .rdcu_pkt_mode_cfg file
 - set the rdcu_par option when using the rdcu_pkt option
-- fixed a bug when using the last_info option
+- fixed several bug when using the last_info option
 
 
 ## [0.09] - 30-09-2022
diff --git a/cmp_tool.c b/cmp_tool.c
index b676c67..78c8b70 100644
--- a/cmp_tool.c
+++ b/cmp_tool.c
@@ -746,11 +746,15 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info)
 	}
 
 	if (rdcu_pkt_mode) {
+		void *tmp = cfg->icu_new_model_buf;
+
+		cfg->icu_new_model_buf = NULL;
 		printf("Generate compression setup packets ...\n");
 		error = gen_rdcu_write_pkts(cfg);
 		if (error)
 			goto error_cleanup;
 		printf("... DONE\n");
+		cfg->icu_new_model_buf = tmp;
 	}
 
 	printf("Compress data ... ");
diff --git a/meson.build b/meson.build
index 01cc9c9..802be0c 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('cmp_tool', 'c',
-  version : '0.10-b.3',
+  version : '0.10-b.4',
   meson_version : '>= 0.56',
   license : 'GPL-2.0',
   default_options : ['warning_level=3', 'c_std=gnu99']
-- 
GitLab