tests/color-icc-output: assert that dimension is not zero when creating clut

Without that we may crash when trying to create a PTYPE_CLUT ICC profile
with dimension zeroed. This would be wrong, so with this change we are
basically validating the test case arguments.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2023-04-26 17:34:03 -03:00 committed by Pekka Paalanen
parent 7ea4075d77
commit 722d7f8c3f
1 changed files with 2 additions and 0 deletions

View File

@ -239,6 +239,8 @@ create_cLUT_from_matrix(cmsContext context_id, const struct lcmsMAT3 *mat, int d
{
cmsStage *cLUT_stage;
assert(dim_size);
cLUT_stage = cmsStageAllocCLutFloat(context_id, dim_size, 3, 3, NULL);
cmsStageSampleCLutFloat(cLUT_stage, sampler_matrix, (void *)mat, 0);