SkColorSpaceXform: clamp before table lookups

The fuzzer has built a single test case that causes out-of-bounds
reads on both the src and dst tables.  I'm glad we have it.

Next follow ups may include:
    - have byte_tables_rgb do its own clamping
    - replace table_{r,g,b} here with a single stage analogous
      to byte_tables_rgb that looks up the three float tables
      safely
    - maybe replace byte_tables_rgb with that.  I'm not really
      sure why src->XYZ tables are floats but XYZ->dst are bytes.

I'm going to try some of these out before attempting to reland
in Chrome.  As usual, rebaselining Blink makes things a pain.

Bug: chromium:772684, skia:7114
Change-Id: Id8759e766330e1c7689c0847bf2cd35d422ebbcd
Reviewed-on: https://skia-review.googlesource.com/57760
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
1 file changed