diff --git a/lib/common/cmp_data_types.c b/lib/common/cmp_data_types.c index d6283ce2017639cfe97cad88485a4ca1bd27e1d9..7c95c9a8ebd00499273426fafa0527d41d1be992 100644 --- a/lib/common/cmp_data_types.c +++ b/lib/common/cmp_data_types.c @@ -943,7 +943,7 @@ int be_to_cpu_chunk(uint8_t *chunk, size_t chunk_size) if (chunk_size < COLLECTION_HDR_SIZE) return -1; - while (col_p < chunk + chunk_size - COLLECTION_HDR_SIZE) { + while (col_p <= chunk + chunk_size - COLLECTION_HDR_SIZE) { struct collection_hdr *col_hdr = (struct collection_hdr *)col_p; enum cmp_data_type data_type = convert_subservice_to_cmp_data_type(cmp_col_get_subservice(col_hdr)); uint32_t data_size = cmp_col_get_data_length(col_hdr); diff --git a/lib/icu_compress/cmp_icu.c b/lib/icu_compress/cmp_icu.c index 8e67c431a48f005b905fbfd6962ff245d1edda5a..1ec466d050e037d8926495fced5bfa4b0c20c3ec 100644 --- a/lib/icu_compress/cmp_icu.c +++ b/lib/icu_compress/cmp_icu.c @@ -2132,7 +2132,7 @@ static int compress_data_internal(const struct cmp_cfg *cfg, int stream_len) return stream_len; if (cfg->samples == 0) /* nothing to compress we are done*/ - return 0; + return stream_len; if (stream_len & 0x7) { debug_print("Error: The stream_len parameter must be a multiple of 8.\n");