Tighten max table entries when parsing and evaluating ICC curves

We have some assumptions elsewhere in the code that hinge on this
being smaller than 2^24.

This will make parsing fail if we are given more than ~16 million
table entries in the profile and makes sure profiles given to us
conform to that limit.

This limit may impact some fringe WebP images in Chromium; see
linked bug for more details.

Bug: b/492744328
Change-Id: I4ca302b490021e2276a55f949f36125dab44196d
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/1187536
Reviewed-by: Florin Malita <fmalita@google.com>
Auto-Submit: Kaylee Lubick <kjlubick@google.com>
1 file changed
tree: 53e13c1d520594c34a3497e82f47c461480e755d
  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