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

fix a overflow

parent de667f2b
No related branches found
No related tags found
1 merge request!12increase code coverage, general code refactoring
......@@ -142,7 +142,7 @@ uint32_t cmp_cfg_icu_buffers(struct cmp_cfg *cfg, void *data_to_compress,
data_size = cmp_cal_size_of_data(compressed_data_len_samples, cfg->data_type);
hdr_size = cmp_ent_cal_hdr_size(cfg->data_type, cfg->cmp_mode == CMP_MODE_RAW);
if ((data_size + hdr_size) > CMP_ENTITY_MAX_SIZE) {
if ((data_size + hdr_size) > CMP_ENTITY_MAX_SIZE || data_size > CMP_ENTITY_MAX_SIZE) {
debug_print("Error: The buffer for the compressed data is too large to fit in a compression entity.\n");
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment