[skcms] Harden CLUT indexing, enforce limits, and add test case

- Add validation for grid point counts to enforce SKCMS_MAX_GRID_POINTS during parsing, protecting index calculations from integer overflow.
- Secure clut() by clamping inputs to the [0, 1] range to prevent negative coordinate indexing and out-of-bounds (OOB) memory access.
- Initialize index and weight arrays in clut() to avoid uninitialized memory use.
- Add test case 'test_CLUT_OutOfBoundsInput' in tests.c to verify safe handling of extreme out-of-bounds input values on both B2A and A2B paths.

Fixed: b/513702971
Change-Id: I3c07496be905ff553e9ee56b10eb586e5e839879
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/1241440
Commit-Queue: Kaylee Lubick <kjlubick@google.com>
Reviewed-by: Kaylee Lubick <kjlubick@google.com>
3 files changed
tree: dafc0def70e4adafcbf30df7855f6bf1b7f8d2d3
  1. bazel/
  2. fuzz/
  3. infra/
  4. ninja/
  5. profiles/
  6. src/
  7. toolchain/
  8. .bazelrc
  9. .bazelversion
  10. .gitignore
  11. BAZEL.md
  12. bench.c
  13. BUILD.bazel
  14. build.ninja
  15. codereview.settings
  16. iccdump.c
  17. LICENSE
  18. MODULE.bazel
  19. MODULE.bazel.lock
  20. msvs.ninja
  21. OWNERS
  22. README.chromium
  23. README.md
  24. skcms.cc
  25. skcms.gni
  26. skcms.h
  27. test_only.c
  28. test_only.h
  29. tests.c
  30. whitespace.txt
README.md

To build with ninja, simply run ninja from the root directory. This will produce a library in /out.

There are also Bazel rules, outlined in BAZEL.md