mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1166252 - Reject lut8/16Type with empty CLUT grid. r=jrmuizel
--HG-- extra : commitid : KiU2IKstYSk
This commit is contained in:
parent
b62c5aa0a3
commit
58bb8fc72f
@ -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++;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user