diff options
author | Leandro Ribeiro <leandro.ribeiro@collabora.com> | 2023-04-26 17:34:03 -0300 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2023-04-27 10:37:38 +0000 |
commit | 722d7f8c3f278b74764a7da68284c5c1f059a601 (patch) | |
tree | 2092b3479e497deb1e066ae38f24db5168c19c28 | |
parent | 7ea4075d777cd9da2d51db117e80b6cea90a1c6d (diff) | |
download | weston-722d7f8c3f278b74764a7da68284c5c1f059a601.tar.gz |
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>
-rw-r--r-- | tests/color-icc-output-test.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/color-icc-output-test.c b/tests/color-icc-output-test.c index 0eac2dd4..62103c4b 100644 --- a/tests/color-icc-output-test.c +++ b/tests/color-icc-output-test.c @@ -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); |