[skcms] Reject invalid curve table counts in skcms_MaxRoundtripError

Above 2^24, float32 precision loss in eval_curve can
round the upper table index past table_entries - 1 and read out of
bounds, so we guard skcms_MaxRoundtripError against null inputs and
table_entries == 1 and above the max. This matches
skcms_ApproximateCurve and read_curve_curv.

Bug: 582184680
Change-Id: I21f8acb712bda68eb505c2cf551c26b57d0537ff
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/1420416
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2 files changed
tree: 16e8825f9926eb349b0979fd078f4a1e7d34d783
  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