Bug 1166252 - Reject lut8/16Type with empty CLUT grid. r=jrmuizel

This commit is contained in:
Benoit Girard 2015-08-25 15:48:55 -04:00
parent dc909a59fe
commit 0f1046b8a7
2 changed files with 9 additions and 0 deletions

View File

@ -134,6 +134,8 @@ static void qcms_transform_module_clut_only(struct qcms_modular_transform *trans
float* b_table = transform->b_clut;
for (i = 0; i < length; i++) {
assert(transform->grid_size >= 1);
float linear_r = *src++;
float linear_g = *src++;
float linear_b = *src++;
@ -188,6 +190,8 @@ static void qcms_transform_module_clut(struct qcms_modular_transform *transform,
float* g_table = transform->g_clut;
float* b_table = transform->b_clut;
for (i = 0; i < length; i++) {
assert(transform->grid_size >= 1);
float device_r = *src++;
float device_g = *src++;
float device_b = *src++;

View File

@ -715,6 +715,11 @@ static struct lutType *read_tag_lutType(struct mem_source *src, struct tag_index
return NULL;
}
if (clut_size <= 0) {
invalid_source(src, "CLUT must not be empty.");
return NULL;
}
if (in_chan != 3 || out_chan != 3) {
invalid_source(src, "CLUT only supports RGB");
return NULL;