Skip to content
Snippets Groups Projects
Commit 6187310c authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

Fix bug when compressing 0 samples

parent d50269c3
No related branches found
No related tags found
1 merge request!26Adapt cmp_tool to the chunk decompression
...@@ -943,7 +943,7 @@ int be_to_cpu_chunk(uint8_t *chunk, size_t chunk_size) ...@@ -943,7 +943,7 @@ int be_to_cpu_chunk(uint8_t *chunk, size_t chunk_size)
if (chunk_size < COLLECTION_HDR_SIZE) if (chunk_size < COLLECTION_HDR_SIZE)
return -1; 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; 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)); 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); uint32_t data_size = cmp_col_get_data_length(col_hdr);
......
...@@ -2132,7 +2132,7 @@ static int compress_data_internal(const struct cmp_cfg *cfg, int stream_len) ...@@ -2132,7 +2132,7 @@ static int compress_data_internal(const struct cmp_cfg *cfg, int stream_len)
return stream_len; return stream_len;
if (cfg->samples == 0) /* nothing to compress we are done*/ if (cfg->samples == 0) /* nothing to compress we are done*/
return 0; return stream_len;
if (stream_len & 0x7) { if (stream_len & 0x7) {
debug_print("Error: The stream_len parameter must be a multiple of 8.\n"); debug_print("Error: The stream_len parameter must be a multiple of 8.\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment