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

fix a bug in the cmp_ent_get_data_buf() function

parent acf80c8c
No related branches found
No related tags found
1 merge request!11decompression/compression for non-imagette data
...@@ -1650,13 +1650,13 @@ void *cmp_ent_get_data_buf(struct cmp_entity *ent) ...@@ -1650,13 +1650,13 @@ void *cmp_ent_get_data_buf(struct cmp_entity *ent)
switch (data_type) { switch (data_type) {
case DATA_TYPE_IMAGETTE: case DATA_TYPE_IMAGETTE:
case DATA_TYPE_SAT_IMAGETTE:
case DATA_TYPE_F_CAM_IMAGETTE: case DATA_TYPE_F_CAM_IMAGETTE:
return ent->ima.ima_cmp_dat; return ent->ima.ima_cmp_dat;
case DATA_TYPE_IMAGETTE_ADAPTIVE: case DATA_TYPE_IMAGETTE_ADAPTIVE:
case DATA_TYPE_SAT_IMAGETTE_ADAPTIVE:
case DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE: case DATA_TYPE_F_CAM_IMAGETTE_ADAPTIVE:
return ent->ima.ap_ima_cmp_data; return ent->ima.ap_ima_cmp_data;
case DATA_TYPE_SAT_IMAGETTE:
case DATA_TYPE_SAT_IMAGETTE_ADAPTIVE:
case DATA_TYPE_OFFSET: case DATA_TYPE_OFFSET:
case DATA_TYPE_BACKGROUND: case DATA_TYPE_BACKGROUND:
case DATA_TYPE_SMEARING: case DATA_TYPE_SMEARING:
...@@ -2038,7 +2038,7 @@ int cmp_ent_write_rdcu_cmp_pars(struct cmp_entity *ent, const struct cmp_info *i ...@@ -2038,7 +2038,7 @@ int cmp_ent_write_rdcu_cmp_pars(struct cmp_entity *ent, const struct cmp_info *i
* returns the needed size * returns the needed size
* @param data_type compression entity data product type * @param data_type compression entity data product type
* @param raw_mode_flag set this flag if the raw compression mode (CMP_MODE_RAW) is used * @param raw_mode_flag set this flag if the raw compression mode (CMP_MODE_RAW) is used
* @param cmp_size_byte size of the compressed data in bytes * @param cmp_size_byte size of the compressed data in bytes (should be a multiple of 4)
* *
* @note if the entity size is smaller than the largest header, the function * @note if the entity size is smaller than the largest header, the function
* rounds up the entity size to the largest header * rounds up the entity size to the largest header
...@@ -2063,6 +2063,8 @@ uint32_t cmp_ent_create(struct cmp_entity *ent, enum cmp_data_type data_type, ...@@ -2063,6 +2063,8 @@ uint32_t cmp_ent_create(struct cmp_entity *ent, enum cmp_data_type data_type,
if (ent_size > CMP_ENTITY_MAX_SIZE) if (ent_size > CMP_ENTITY_MAX_SIZE)
return 0; return 0;
/* to be safe a compression entity should be at least the size of the
* largest entity header */
if (ent_size < sizeof(struct cmp_entity)) if (ent_size < sizeof(struct cmp_entity))
ent_size = sizeof(struct cmp_entity); ent_size = sizeof(struct cmp_entity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment